Guest User

DK SNR

a guest
Jan 19th, 2013
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.42 KB | None | 0 0
  1. -------------------------------------
  2. -- DIAMOND KROOKS SNR --
  3.  
  4. function ulx.dksnr(calling_ply, target_plys)
  5.     for _, v in pairs( target_plys ) do
  6.         if v.totalz == 3 then
  7.             ULib.ban(v, 10080, "[Auto SNR] One week ban for too much RDM.")
  8.             --ULib.kick(v, "Too much RDM.") --For Bot Testing.
  9.         end
  10.         if v.snr then
  11.             ULib.tsayError( calling_ply, v:Nick() .. " is already being slain by " .. v.snrby, true )
  12.         else
  13.             if v.totalz == nil then
  14.                 v.totalz = 1
  15.             end --if
  16.             v.snr = true
  17.             v.snrby = calling_ply:IsValid() and calling_ply:Nick() or "(Console)"
  18.             ULib.tsayError( v, v:Nick() .. " is being slain the following round for RDM. Warning ("..v.totalz.."/3)", true )
  19.         end --if
  20.         hook.Add( "PlayerDisconnected", "RDM and Run "..v:Nick(), function()
  21.             if v.totalz == 1 and v.snr then
  22.                 ULib.ban(v, 0, "[Auto SNR] RDM and Run.")
  23.                 --ULib.kick(v, "Too much RDM.") --For Bot Testing
  24.             end
  25.         end)
  26.         hook.Add("TTTBeginRound", "SNR "..v:Nick(), function()
  27.             if v.snr then
  28.                 v:Kill()
  29.                 v.snr = nil
  30.                 v.snrby = nil
  31.                 v.totalz = v.totalz + 1
  32.             end --if
  33.         end) --function
  34.     end --for
  35.     ulx.fancyLogAdmin( calling_ply, "#A is slaying #T the following round for RDM.", target_plys )
  36. end
  37. local _dksnr = ulx.command( CATEGORY_NAME, "ulx snr", ulx.dksnr, "!snr" )
  38. _dksnr:addParam{ type=ULib.cmds.PlayersArg }
  39. _dksnr:defaultAccess( ULib.ACCESS_ADMIN )
  40. _dksnr:help( "Slays target(s) the following round for RDM." )
Advertisement
Add Comment
Please, Sign In to add comment