Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. local function ccRemoveCheck(ply, cmd, args)
  2.     if ply:EntIndex() ~= 0 and not ply:HasPriv("rp_commands")then
  3.         ply:PrintMessage(2, string.format(LANGUAGE.need_admin, "rp_removechecks"))
  4.         return
  5.     end
  6.  
  7.     local target = FindPlayer(args[1])
  8.  
  9.     if target then
  10.         for k, v in pairs(ents.FindByClass("darkrp_cheque")) do
  11.             if v.SID == target.SID then v:Remove() end
  12.         end
  13.     else
  14.         -- Remove ALL letters
  15.         for k, v in pairs(ents.FindByClass("darkrp_cheque")) do
  16.             v:Remove()
  17.         end
  18.     end
  19.    
  20.     if ply:EntIndex() == 0 then
  21.         DB.Log("Console force-removed all checks!" )
  22.     else
  23.         DB.Log(ply:SteamName().." ("..ply:SteamID()..") force-removed all letters" )
  24.     end
  25. end
  26. concommand.Add("rp_removechecks", ccRemoveCheck)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement