On line 1 of that code, there's an space that will break it
where you have: ulx.respawn (calling_ply, target_ply )
it should say: ulx.respawn( calling_ply, target, ply )
In other words, remove the space inbetween ulx.respawn and the (
Also, if you have that code in it's own file and never set CATEGORY_NAME to something, it won't create a category for it (or put the command into one) - I think
Tried to fix it on my own and ended up with this code:
function ulx.respawn( calling_ply, target_ply )
if (target_ply:Team() == TEAM_GUARD_DEAD) then
target_ply:SetTeam(TEAM_GUARD)
target_ply:Spawn()
ulx.fancyLogAdmin( calling_ply, true, "#A respawned #T", target_ply )
elseif (target_ply:Team() == TEAM_PRISONER_DEAD) then
target_ply:SetTeam(TEAM_PRISONER)
target_ply:Spawn()
ulx.fancyLogAdmin( calling_ply, true, "#A respawned #T", target_ply )
end
end
local respawn = ulx.command( "RespawnMe", "ulx respawn", ulx.respawn, "!respawn", false )
respawn:addParam{ type=ULib.cmds.PlayerArg }
respawn:defaultAccess( ULib.ACCESS_ADMIN )
respawn:help( "Respawns a player" )
The command shows up in the list and somewhat works
I made myself a guard then killed myself mid-round (with a bunch of bots so the round wouldn't end) then I tried to use the command and I was teleported to a starting point but I was still a spectator
Almost as if it tried to spawn me but the gamemode wouldn't let it
Try checking through the gamemode files and see if you can find anything about that
For example, I tried making a command similar to this (but for PointShop and on TTT)
I had the same problem (being teleported to a spawn location, but not spawning)
For TTT, I had to use v:SpawnForRound( true )
This gamemode might require something similar
Here's the link for that thread if you want to read it:
/index.php/topic,7446.0.html