25.12.2013, 20:34
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.
#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.