Advertisement
Guest User

1121

a guest
May 22nd, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. function ulx.slay( calling_ply, target_plys )
  2.     local affected_plys = {}
  3.  
  4.     for i=1, #target_plys do
  5.         local v = target_plys[ i ]
  6.  
  7.         if ulx.getExclusive( v, calling_ply ) then
  8.             ULib.tsayError( calling_ply, ulx.getExclusive( v, calling_ply ), true )
  9.         elseif not v:Alive() then
  10.             ULib.tsayError( calling_ply, v:Nick() .. " is already dead!", true )
  11.         elseif v:IsFrozen() then
  12.             ULib.tsayError( calling_ply, v:Nick() .. " is frozen!", true )
  13.         else
  14.             v:Kill()
  15.             table.insert( affected_plys, v )
  16.         end
  17.     end
  18.  
  19.     ulx.fancyLogAdmin( calling_ply, "#A slayed #T", affected_plys )
  20. end
  21. local slay = ulx.command( CATEGORY_NAME, "ulx slay", ulx.slay, "!slay" )
  22. slay:addParam{ type=ULib.cmds.PlayersArg }
  23. slay:defaultAccess( ULib.ACCESS_ADMIN )
  24. slay:help( "Slays target(s)." )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement