Author Topic: Running a Check  (Read 1528 times)

0 Members and 1 Guest are viewing this topic.

Offline GravityWolf

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Running a Check
« on: March 21, 2017, 07:22:46 PM »
I am currently trying to make a file inside of fretta run a check for if someone is in a user group but I cannot seem to get it to work. Using ply:IsAdmin() is great in all but when someone is in another staff rank group it won't run the check.

It just turns around telling me that I cannot join because of the check.

Code: [Select]
if (iOldTeam == TEAM_PROPS or iOldTeam == TEAM_HUNTERS or iOldTeam == TEAM_UNASSIGNED) then
    if not ply:IsUserGroup("superadmin") or not ply:IsUserGroup("admin") or not ply:IsUserGroup("enforcer") or not ply:IsUserGroup("moderator") or not ply:IsUserGroup("seniormoderator") then
        return ply:ChatPrint("The Spectator Team is only for Admin Use! Please select another team!")
    end
end

[Added] It actually doesn't work for any ranks when using ply:IsUserGroup().

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Running a Check
« Reply #1 on: March 21, 2017, 10:27:32 PM »
since you're using not, use and not or.


Your logic is always returning false

alternatively.. you can just return all of the 'not's