General > Developers Corner

need some help

(1/1)

[FL:RP] Jimakis98:
So i made a new command for ulx but i want it to show me that a player is alive if he is and end the fuction there but if a player is alive then it respawns him. So what i want is when a players is dead i want it to respawn the player and if not to show a message that the player is alive


--- Code: ---function ulx.respawn (calling_ply, target_ply )
if not target_ply:Alive() then

ulx.fancyLogAdmin( target_ply, "is not dead")

else

target_ply:Spawn()
ulx.fancyLogAdmin( calling_ply, true, "#A forced respawned #T", target_ply )

end
end

--- End code ---

Tomzen:

--- Quote from: [FL:RP] Jimakis98 on June 04, 2015, 01:40:19 AM ---So i made a new command for ulx but i want it to show me that a player is alive if he is and end the fuction there but if a player is alive then it respawns him. So what i want is when a players is dead i want it to respawn the player and if not to show a message that the player is alive


--- Code: ---function ulx.respawn (calling_ply, target_ply )
if not target_ply:Alive() then

ulx.fancyLogAdmin( target_ply, "is not dead")

else

target_ply:Spawn()
ulx.fancyLogAdmin( calling_ply, true, "#A forced respawned #T", target_ply )

end
end

--- End code ---

--- End quote ---

Wait so you want it to end the function if he is alive, and respawn him if he is not? or respawn him if he is alive and end if he is dead?

[FL:RP] Jimakis98:
Let me make this clear.

If player is dead > respawn him , show message that you respawned him

If player alive > show message player is alive

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given

[0] Board index

Go to full version