Advertisement
Guest User

ULX Slay /w Reason

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