Advertisement
PlayersZero

Gmod Secret Spectate (Admin tool)

Jan 28th, 2019
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.36 KB | None | 0 0
  1. local CATEGORY_NAME = "Essentials"
  2.  
  3. function ulx.secretspec( calling_ply, target_ply, should_unsspec )
  4.     if should_unsspec then
  5.         target_ply:SetTeam(2)
  6.         if calling_ply == target_ply then
  7.             ulx.fancyLogAdmin(calling_ply, true, "#A left secretspec")
  8.         elseif calling_ply != target_ply then
  9.             ulx.fancyLogAdmin(calling_ply, true, "#A made #T leave secretspec", target_ply)
  10.         end
  11.     else
  12.         if IsValid(target_ply) then
  13.             target_ply:SetTeam(TEAM_UNASSIGNED)
  14.             target_ply:KillSilent()
  15.             if calling_ply == target_ply then
  16.                 ulx.fancyLogAdmin(calling_ply, true, "#A entered secretSpec")
  17.             else
  18.                 ulx.fancyLogAdmin(calling_ply, true, "#A made #T enter secretSpec", target_ply)
  19.             end
  20.         elseif !IsValid(target_ply) then
  21.             ULib.tsayError("Not a valid target!")
  22.         end
  23.     end
  24. end
  25.  
  26. local secretspec = ulx.command(CATEGORY_NAME, "ulx secretspec", ulx.secretspec, "!secretspec", false)
  27. secretspec:addParam({type = ULib.cmds.PlayerArg})
  28. secretspec:addParam{ type=ULib.cmds.BoolArg, invisible=true }
  29. secretspec:defaultAccess(ULib.ACCESS_ADMIN)
  30. secretspec:help("Are we rushing in, are we going all sneaky beaky like?")
  31. secretspec:setOpposite("ulx unsspec", {_, _, true}, "!unsspec")
  32. //Works for gamemodes like Murder
  33. //Made by Zero
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement