Pivity

DARKRP Moderator on Duty help

Last read Never
#1

I need help with darkrp, I need it so admins and trial moderators can only use noclip when they have the job of Moderator on Duty "TEAM_MOD" 

#2
hook.Add("PlayerNoClip", "modchecknoclipthing", function(ply, desiredState)
    if(ply:Team() == TEAM_MOD) then return true end -- only allow them if they're the moderator job
end)

Throw that in a lua file inside garrysmod/lua/autorun/server

(Edited to include BullyHunter's correction, good catch xx)

#3

^ will cause conflicts with other hooks.

if (ply:Team() == TEAM_MOD) then return true end

is better than

return ply:Team() == TEAM_MOD

Agree x 1Informative x 1
Users viewing this thread
Nobody