SA-MP Forums Archive
hostpital - 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: hostpital (/showthread.php?tid=357866)



hostpital - thefatshizms - 08.07.2012

Hello, under OnPlayerDeath i set his postition to a hospital interior but once you die and tele there u then die again and respawn how to fix this?


Re: hostpital - Frosty_LV - 08.07.2012

hmm, maybe set his hp?


Re: hostpital - coole210 - 08.07.2012

If you set his position in OnPlayerDeath he will just be teleported when he is on the ground dying, you should set a variable in OnPlayerDeath, and in OnPlayerSpawn set their position to a hospital interior if the variable is true.

example:

pawn Код:
//Top of script:
new bool:JustDied[MAX_PLAYERS] = false;

//OnPlayerDeath:

JustDied[playerid] = true;

//OnPlayerSpawn:

if(JustDied[playerid])
{
JustDied[playerid] = false;
//Set position to hospital interior
}