Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. function SetAdminModeVar()
  2. for k, v in ipairs(player.GetAll()) do
  3. v:SetNWBool('adminmode', false)
  4. end
  5. end
  6. hook.Add("PlayerSpawn", "CKGSetAdminVars", SetAdminModeVar())
  7.  
  8. function ulx.adminmode(calling_ply)
  9.  
  10. local orgmodel
  11. local staffmodel = "models/player/gman_high.mdl"
  12. if calling_ply:GetNWBool('adminmode') == false then orgmodel = calling_ply:GetModel() end
  13. if calling_ply:GetNWBool('adminmode') == true then
  14. calling_ply:SetModel(orgmodel)
  15. calling_ply:SetNWBool('adminmode', false)
  16. return end
  17.  
  18. calling_ply:SetModel(staffmodel)
  19. calling_ply:SetNWBool('adminmode', true)
  20.  
  21. hook.Add("PlayerShouldTakeDamage", "CKGGodmode", function ()
  22. if calling_ply:GetNWBool('adminmode') == true then
  23. return false
  24. end
  25. end)
  26. end
  27. local adminmode = ulx.command( "CKG Staff", "ulx adminmode", ulx.adminmode, "!adminmode" )
  28. adminmode:addParam{type=ULib.cmds.PlayersArg}
  29. adminmode:defaultAccess( ULib.ACCESS_ADMIN )
  30. adminmode:help("Toggles administrator mode.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement