SA-MP Forums Archive
Respawn after death in filterscript - 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: Respawn after death in filterscript (/showthread.php?tid=628510)



Respawn after death in filterscript - PeanutButter - 11.02.2017

I am making a filterscript and need to respawn players when they die. I am currently doing it with a timer that respawns the player after they die.


OnPlayerDeath
PHP код:
SetTimerEx("SpawnDelay"5000false"i"playerid); 
PHP код:
forward SpawnDelay(playerid);
public 
SpawnDelay(playerid)
{
    
SpawnThePlayer(playerid1);
    
SetPlayerGuns(playerid);

This doesn't feel very smooth. When the player gets killed, the gamemode respawns him first, then my filterscript respawns him again. The gamemode itself should not be updated. How can I make the respawn faster?


Re: Respawn after death in filterscript - AndreiWow - 11.02.2017

Well, lower the timer to respawn him faster?


Re: Respawn after death in filterscript - Wolfe - 11.02.2017

TogglePlayerSpectating when the player dies

Then re-toggle it to where the timer is up and spawn them

https://sampwiki.blast.hk/wiki/TogglePlayerSpectating