PDA

View Full Version : prevent player from respawning


Sascha
09/08/2013, 11:04 AM
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?

Necip
09/08/2013, 11:14 AM
What you can simply do is put the play in Spectate mode just where he died maybe?

Sascha
09/08/2013, 11:19 AM
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...

sleepysnowflake
09/08/2013, 12:01 PM
You could also try to set player's camera to look at the place where he died, that is an idea;

Sascha
09/08/2013, 12:10 PM
yea, but the camera would be moved for a short time when the player respawns... and then it wouldn't be fluently againD:

JimmyCh
09/08/2013, 12:24 PM
Maybe you can do the following:

//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..