Posts: 737
Threads: 338
Joined: Jan 2013
Hi,
It's possible to do, if player take that amount of damage when player is dieding,to make player not die?
Posts: 2,593
Threads: 34
Joined: Dec 2007
Yes its possible
new Float:CurrentHealth[MAX_PLAYERS];
+
SetPlayerTeam
Posts: 737
Threads: 338
Joined: Jan 2013
But i try.. When player have a 1 HP, i jump from high build, and i have dead.. Yes, i got 100HP, but i want to make, you don't die.
Posts: 2,593
Threads: 34
Joined: Dec 2007
Use SetPlayerHealth(playerid, Float:0x7F800000);
Posts: 737
Threads: 338
Joined: Jan 2013
I don't want to have a lot of HP.. I just want, when you have to die, you will be will alive, you will get HP.
Posts: 937
Threads: 69
Joined: Dec 2009
Reputation:
0
I can think of two ways to make this but you will have to script them yourself.
#1: If you want to fix that player dies when you fall from high, you gotta check for animations. If player has the falling animation, set the timer and set his health to Float:0x7F800000. When the animation will stop kill the timer and set players health to 100 or to what it was before player fell. If this method is not going to work, use MapAndreas plugin or include and set players pos to the ground to prevent him from falling.
#2: This way is a bit of noticeable but will work. When player dies, get his current position and set a death variable to true. After, under OnPlayerSpawn, if death variable is true, set players pos to where he died. This is tricky and if you have stats system, you will need variable for death so other statements won't not be counting or whatever.
Good luck.
EDIT: You will still need to use the OnPlayerTakeDamage callback for both methods.
Also, I'm not sure if you can somehow return 0 under OnPlayerDeath callback, don't know what will happen but once you start scripting, test it as well besides to what you actually going to script. If it would work like this, it would of prevent from the rest of the code being executed.