Instant Respawn After Death - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Instant Respawn After Death (
/showthread.php?tid=545995)
Instant Respawn After Death -
arakuta - 11.11.2014
So guys, in order to make a fast respawn system, i just put a SpawnPlayer ot OnPlayerDeath.
The problem is that the player just die right after respawn
https://www.youtube.com/watch?v=fCor52uV-Ps
Can you guys help me? Thanks
Re: Instant Respawn After Death -
Abagail - 11.11.2014
Seems like an issue with your code!
Try this?
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
SpawnPlayer(playerid);
SetPlayerPos(playerid, // their position, or whatever
SetPlayerHealth(playerid, 100.0);
return true;
}
If this works then it is an issue with your code, and moreso not a SA:MP bug!(which it's not!).
Unless you want to show your code, we can't really fix it.
Re: Instant Respawn After Death -
Eth - 11.11.2014
better than the above try this:
OnPlayerDeath:
Re: Instant Respawn After Death -
Quickie - 12.11.2014
@Eth
Quote:
Originally Posted by arakuta
So guys, in order to make a fast respawn system, i just put a SpawnPlayer ot OnPlayerDeath.
The problem is that the player just die right after respawn
https://www.youtube.com/watch?v=fCor52uV-Ps
Can you guys help me? Thanks
|
Re: Instant Respawn After Death -
Banana_Ghost - 12.11.2014
Try this:
pawn Код:
public OnPlayerDeath(playerid,killerid,reason)
{
TogglePlayerSpectating(playerid, 1); //toggles them into spectation mode.
TogglePlayerSpectating(playerid, 0); //ends spectation mode, calling OnPlayerSpawn.
return 1;
}