Ulysses
General => Developers Corner => Topic started by: Aceman9622 on June 24, 2015, 07:28:11 PM
-
Right, so I need help with my Jailbreak commands for respawning players in case they were RDMed.
I use Excl's Jailbreak 7.
function ulx.spawn( calling_ply, target_plys )
local affected_plys = {}
for k,v in pairs(target_plys) do
if !v:Alive() then
v:Spawn()
table.insert(affected_plys, v)
end
end
ulx.fancyLogAdmin( calling_ply, "#A respawned #T", affected_plys )
end
local spawn = ulx.command( "Utility", "ulx respawn", ulx.spawn, "!respawn" )
spawn:addParam{ type=ULib.cmds.PlayersArg }
spawn:defaultAccess( ULib.ACCESS_SUPERADMIN )
spawn:help( "Respawned target(s)." )
Any help? This code works, but when it respawns a player, it doesn't respawn them physically. It sends them to a different living player in spectator mode. Any idea on how to fix this?
Code was not written by me.
-
Might try looking at the two releases that already include respawn code and learn from them.
Player Force Spawn (http://forums.ulyssesmod.net/index.php/topic,8100.0.html)
or
Trouble in Terrorist Town Commands for ULX (http://forums.ulyssesmod.net/index.php/topic,6279.0.html)
The second one even has a respawntp (respawn to where admin pointing)
-
Hm, the Force Respawn doesn't seem to work. I've tried, but I think Excl's Jailbreak prevents it. Possibly?
-
If the Jailbreak gamemode overwrites any standard Gmod functions, then it's quite possible, yes.
That's one nice thing about the Gamemode library though, the ability to change the default actions.
It can just cause issues like you are experiencing with 3rd party additions though.