Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function SetAdminModeVar()
- for k, v in ipairs(player.GetAll()) do
- v:SetNWBool('adminmode', false)
- end
- end
- hook.Add("PlayerSpawn", "CKGSetAdminVars", SetAdminModeVar())
- function ulx.adminmode(calling_ply)
- local orgmodel
- local staffmodel = "models/player/gman_high.mdl"
- if calling_ply:GetNWBool('adminmode') == false then orgmodel = calling_ply:GetModel() end
- if calling_ply:GetNWBool('adminmode') == true then
- calling_ply:SetModel(orgmodel)
- calling_ply:SetNWBool('adminmode', false)
- return end
- calling_ply:SetModel(staffmodel)
- calling_ply:SetNWBool('adminmode', true)
- hook.Add("PlayerShouldTakeDamage", "CKGGodmode", function ()
- if calling_ply:GetNWBool('adminmode') == true then
- return false
- end
- end)
- end
- local adminmode = ulx.command( "CKG Staff", "ulx adminmode", ulx.adminmode, "!adminmode" )
- adminmode:addParam{type=ULib.cmds.PlayersArg}
- adminmode:defaultAccess( ULib.ACCESS_ADMIN )
- adminmode:help("Toggles administrator mode.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement