Ulysses

General => Developers Corner => Topic started by: GravityWolf on March 21, 2017, 07:22:46 PM

Title: Running a Check
Post by: GravityWolf 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().
Title: Re: Running a Check
Post by: MrPresident 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