13.08.2017, 06:18
Look how I see your problem: The player dies and when he spawns SOMEONE or SOMETHING kills him [ SetPlayerHealth(playerid,0.0)? ], and because of this OnPlayerDeath gets called 1 more time.
You may say you debugged LastHealth, but go and put a // in front of SetPlayerHealth at OnPlayerSpawn.
Look at your debug:
The player dies (he's in event) - OnPlayerDeath #2; now the player spawns, and SpawnEx is still true so - OnPlayerSpawn #2; but it gets killed there so OnPlayerDeath is called again (this time with #1 because SpawnEx was set to false previously)
If this is not working go and find timers/anything else that can kill your player after spawning.
Quote:
LastHealth variable will never be 0.0, I debugged it, it works fine
|
Look at your debug:
PHP код:
[18:33:43] Called - OnPlayerDeath #2
[18:33:43] Called - OnPlayerSpawn
[18:33:43] Called - OnPlayerSpawn #2
[18:33:43] Called - OnPlayerDeath #1
[18:33:43] Called - OnPlayerRequestClass #1
[18:33:43] Called - OnPlayerRequestClass #2
[18:33:43] Called - OnPlayerSpawn
If this is not working go and find timers/anything else that can kill your player after spawning.