Alright I've made it so it actually slays the user thanks to everyone. But there is one more problem, it dosen't print anything into the chat. I want it to print like Aqua slayed Blah for RDM or something like that. This is the code so far.
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." )