SA-MP Forums Archive
prevent player from respawning - 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: prevent player from respawning (/showthread.php?tid=457125)



prevent player from respawning - Sascha - 09.08.2013

Hi guys,
I'm wondering whether there is a way to prevent the player from respawning after death...
I want the player to stay in his death position for a while (so basicly maybe set his health to 1 when he dies).
But if I'm correct, setting the health to 1 when the player is dead doesn't affect anything.

So is there a way (without using a health check at "OnPlayerUpdate") to freeze the player at the spot he died with maybe a HP of 1?


Re: prevent player from respawning - Necip - 09.08.2013

What you can simply do is put the play in Spectate mode just where he died maybe?


Re: prevent player from respawning - Sascha - 09.08.2013

Well, I would simply set the player's position to the old spot after respawning, but I want a fluent screen, without the player being at another position for a short time on the player's screen...

so something that would even prevent him from respawning would be nice...


Re: prevent player from respawning - sleepysnowflake - 09.08.2013

You could also try to set player's camera to look at the place where he died, that is an idea;


Re: prevent player from respawning - Sascha - 09.08.2013

yea, but the camera would be moved for a short time when the player respawns... and then it wouldn't be fluently againD:


Re: prevent player from respawning - JimmyCh - 09.08.2013

Maybe you can do the following:
pawn Код:
//We're OnPlayerDeath now
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
/* then of course, since u want him to stay at that spot after death, you can even create a timer for this, on which he will stay there, maybe also an animation of him laying on the ground */
SetPlayerPos(playerid, X, Y,Z);
//ApplyAnimation(playerid,"PED","FALL_back",4.1,1,1,1,1,25000,1);
//U can add the thing up so its an animation for 25 seconds..