Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------------------ Slay ------------------------------
- function ulx.slay( calling_ply, target_plys, reason )
- local affected_plys = {}
- for i=1, #target_plys do
- local v = target_plys[ i ]
- if ulx.getExclusive( v, calling_ply ) then
- ULib.tsayError( calling_ply, ulx.getExclusive( v, calling_ply ), true )
- elseif not v:Alive() then
- ULib.tsayError( calling_ply, v:Nick() .. " is already dead!", true )
- elseif v:IsFrozen() then
- ULib.tsayError( calling_ply, v:Nick() .. " is frozen!", true )
- else
- v:Kill()
- table.insert( affected_plys, v )
- end
- end
- ulx.fancyLogAdmin( calling_ply, "#A slayed #T for (#s)", affected_plys, reason )
- end
- local slay = ulx.command( CATEGORY_NAME, "ulx slay", ulx.slay, "!slay" )
- slay:addParam{ type=ULib.cmds.PlayersArg }
- slay:addParam{ type=ULib.cmds.StringArg, hint="reason", ULib.cmds.optional, ULib.cmds.takeRestOfLine, completes=ulx.common_kick_reasons }
- slay:defaultAccess( ULib.ACCESS_ADMIN )
- slay:help( "Slays Target." )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement