My Admin on Duty is not working for Moderator but is working for any other rank?

Here is my code for the job. I hope someone knows what’s wrong or to add something. Thx!

TEAM_AOD = AddExtraTeam(“Admin on Duty”, {
color = Color (0, 136, 136),
model = “models/player/barney.mdl”,
description = [[You are a admin. Move your ass and watch the server!]],
weapons = {“arrest_stick”,“unarrest_stick”},
command = “aod”,
max = 0,
salary = 250,
admin = 1,
vote = false,
hasLicence = false,
prior = false,
customCheck = function(ply)
return CLIENT or ply:GetUserGroup() == “moderator”
end
})

Put your cusomCheck function in one line for visibility’s sake. And for future reference use [noparse]




[/noparse] tags. Also, I don’t know what the “prior = false,” is there, but it isn’t a parameter on the wiki( just checked )

You can add your own variables to the table, it helps when making custom jobs that you later want to do some checks with in a different script, when a player changes job or anything job related you can do job.prior for example, it’s useful for certain things.

Also, it’s only defined for moderator, make it like this



local ranks = {["moderator"] = true, ["admin"] = true } 

TEAM_AOD = AddExtraTeam("Admin on Duty", {
    color = Color (0, 136, 136),
    model = "models/player/barney.mdl",
    description = [[You are a admin. Move your ass and watch the server!]],
    weapons = {"arrest_stick","unarrest_stick"},
    command = "aod",
    max = 0,
    salary = 250,
    admin = 1,
    vote = false,
    hasLicence = false,
    prior = false,
    customCheck = function(ply)
        return CLIENT or ranks[ply:GetUserGroup()]
    end
})


Okay, thanks.

I know what’s it’s for. I just think the op shouldn’t be messing with custom parameters if he can’t get a customCheck function working :v:

I presumed you knew, that was just more of a global statement to others wondering :slight_smile:

An admin*

Btw hello Anon.