I have been having problems with my server and respawning so if you can help this is what it looks like.
function ulx.respawn(calling_ply,target_plys)
local affected_plys = {}
for k,v in pairs(target_plys) do
if (not v:Alive()) and (v:Team() == 1 or v:Team() == 2) then
table.insert(affected_plys,v)
else
ULib.tsayError(calling_ply,v:Nick().." is spectator or alive!")
end
end
for k,v in pairs(affected_plys) do
v:Spawn()
end
ulx.fancyLogAdmin( calling_ply, "#A respawned #T", affected_plys)
end
local respawn = ulx.command("JailBreak", "ulx respawn", ulx.respawn, {"!respawn","!rs"},true)
respawn:addParam{ type=ULib.cmds.PlayersArg }
respawn:defaultAccess( ULib.ACCESS_SUPERADMIN )
respawn:help( "Respawn target<s>" )