OnPlayerSpawn
#1

in OnPlayerSpawn callback, getplayerhealth returns 0
Reply
#2

Maybe it's because it's called in such a fast way that health isn't really registered? I'll run some tests when I get the time later today to see.... But, as far as I know, You just spawned. Health might not have had time to set. (The float in the script)

Edit:

I did it, running a timer for 100 milliseconds. On the time of spawn, the player's health is in fact, 0. But, soon after, it's 100. SA-MP bug, :P

Code:
[17:50:43] Health: 0.000000
[17:50:43] Health: 0.000000
[17:50:43] Health: 0.000000
[17:50:43] Health: 0.000000
[17:50:43] Health: 0.000000
[17:50:44] Health: 0.000000
[17:50:44] Health: 0.000000
[17:50:44] Health: 0.000000
[17:50:44] Health: 0.000000
[17:50:44] Health: 0.000000
[17:50:44] Health: 0.000000
[17:50:44] Health: 0.000000
[17:50:44] Health: 0.000000
[17:50:44] Health: 0.000000
[17:50:45] Health: 0.000000
[17:50:45] Health: 0.000000
[17:50:45] Health: 0.000000
[17:50:45] Health: 0.000000
[17:50:45] Health: 0.000000
[17:50:45] Health: 0.000000
[17:50:46] Health: 0.000000
[17:50:46] Health: 0.000000
[17:50:46] Spawned 


[17:50:46] Health: 100.000000
[17:50:46] Health: 100.000000
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)