OnPlayerTakeDamage issue - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerTakeDamage issue (
/showthread.php?tid=637516)
OnPlayerTakeDamage issue -
arad55 - 16.07.2017
Hello, I'm following a player's health/armor with OnPlayerTakeDamage, but sometimes it appears that the actual GetPlayerHealth/Armour won't be updated for a few seconds after the callback was triggered, and even more times that the callback is triggered but the player takes no damage at all (unlike what is stated in OnPlayerTakeDamage).
Is there any way to solve this issue?
Re: OnPlayerTakeDamage issue -
JasonRiggs - 16.07.2017
I cannot understand what you're trying to say, Post Lines, In Game/Compile errors so we can help..
Re: OnPlayerTakeDamage issue -
arad55 - 16.07.2017
I'm following a player's health at all times by OnPlayerTakeDamage, but sometimes the callback is being called, but the player hasn't actually been damaged so player health stays the same as before the callback. Probably due to lags or packet loss. Is there a way to fix it?
Re: OnPlayerTakeDamage issue -
Abagail - 16.07.2017
Health & armor are not updated when OnPlayerTakeDamage is called.
Re: OnPlayerTakeDamage issue -
arad55 - 16.07.2017
Quote:
Originally Posted by Abagail
Health & armor are not updated when OnPlayerTakeDamage is called.
|
Sorry, didn't explain it correctly. I am having a timer check if both GetPlayerHealth and the health var which is updated in OnPlayerTakeDamage are equal. Many times they are not, and player hasn't really get damaged, but the callback was called.
Re: OnPlayerTakeDamage issue -
Paulice - 16.07.2017
My advice, either use
this or do the same in another way (set all players' team to the same ID, set custom damages for every weapon ID, etc.)
Re: OnPlayerTakeDamage issue -
Daymen - 16.07.2017
Please post the code you're working with and we'll get a better understanding of what you're trying to do and how we can help.