SA-MP Forums Archive
GetPlayerHealth isn't working right. - 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: GetPlayerHealth isn't working right. (/showthread.php?tid=541125)



GetPlayerHealth isn't working right. - AfikAtashga - 09.10.2014

Hey, i'm working on an anti-cheat. and lately, i've got a bug,
The checking timer that compares between the health is running every 150 miliseceonds.
I've making that check:
Код:
GetPlayerHealth(playerid, AC_FLOAT[1]);
if(floatround(AC_FLOAT[1], floatround_round) != floatround(GetPlayerHealthEx(playerid), floatround_round))
GetPlayerHealthEx is a pVar that changed with SetPlayerHealthEx.
All mode optimized to the anti-cheat, but i've got a bug with that.
I did a sendclientmessage when he's detecting has a cheater, but when i make command of /Kill, that mean
Код:
SetPlayerHealthEx(playerid, 0.0);
in the gamemode, is detecting that the pVar amount is 0.0, and original health in sa-mp is 100.0, but on-screen, i see 0, on screen i mean to: is empty.

If i'm making the command in the filterscript on the anticheat, it work..
What can be the problem?

Thanks.


Re: GetPlayerHealth isn't working right. - AfikAtashga - 10.10.2014

UP..


Re: GetPlayerHealth isn't working right. - Abagail - 10.10.2014

Show your SetPlayerHealthEx command. Perhaps, - you don't ACTUALLY set the player's health?


Re: GetPlayerHealth isn't working right. - AfikAtashga - 10.10.2014

Quote:
Originally Posted by Abagail
Посмотреть сообщение
Show your SetPlayerHealthEx command. Perhaps, - you don't ACTUALLY set the player's health?
I did, and i said, when i make the command in the filterscript of the anticheat and not in the gamemode it work..

Код:
#define SetPlayerHealthEx(%0,%1) SetPlayerHealth(%0, %1); SetPVarFloat(%0, "PlayerHealth", %1)



Re: GetPlayerHealth isn't working right. - AfikAtashga - 11.10.2014

UP..


Re: GetPlayerHealth isn't working right. - AfikAtashga - 11.10.2014

UPUP


Re: GetPlayerHealth isn't working right. - AfikAtashga - 14.10.2014

UP..