OnPlayerDeath getting called twice
#10

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.

Quote:
Originally Posted by oMa37
Посмотреть сообщение
LastHealth variable will never be 0.0, I debugged it, it works fine
You may say you debugged LastHealth, but go and put a // in front of SetPlayerHealth at OnPlayerSpawn.
Look at your debug:
PHP код:
[18:33:43Called OnPlayerDeath #2 
[18:33:43Called OnPlayerSpawn 
[18:33:43Called OnPlayerSpawn #2 
[18:33:43Called OnPlayerDeath #1 
[18:33:43Called OnPlayerRequestClass #1 
[18:33:43Called OnPlayerRequestClass #2 
[18:33:43Called OnPlayerSpawn 
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.
Reply


Messages In This Thread
OnPlayerDeath getting called twice - by oMa37 - 12.08.2017, 16:03
Re: OnPlayerDeath getting called twice - by GaByM - 12.08.2017, 16:49
Re: OnPlayerDeath getting called twice - by oMa37 - 12.08.2017, 16:55
Re: OnPlayerDeath getting called twice - by oMa37 - 12.08.2017, 17:21
Re: OnPlayerDeath getting called twice - by GaByM - 12.08.2017, 19:18
Re: OnPlayerDeath getting called twice - by oMa37 - 12.08.2017, 22:04
Re: OnPlayerDeath getting called twice - by GaByM - 12.08.2017, 22:13
Re: OnPlayerDeath getting called twice - by pabloalber84ban - 12.08.2017, 22:46
Re: OnPlayerDeath getting called twice - by oMa37 - 13.08.2017, 00:02
Re: OnPlayerDeath getting called twice - by GaByM - 13.08.2017, 06:18

Forum Jump:


Users browsing this thread: 1 Guest(s)