SetPlayerHealth/Armour GetplayerHealth/Armour fails? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SetPlayerHealth/Armour GetplayerHealth/Armour fails? (
/showthread.php?tid=243629)
SetPlayerHealth/Armour GetplayerHealth/Armour fails? -
KaleOtter - 23.03.2011
Hello,
My anticheat is working like:
SetPlayerArmour(playerid,75);
pS[Armour] = 75;
And my one second timer detect:
GetPlayerArmour(playerid,pS[ClientArmour);
pS[ClientArmour] == 0.00000
pS[Armour] == 75.0000
Not a problem but then:
pS[Armour = pS[ClientArmour];
And then:
GetPlayerArmour(playerid,pS[ClientArmour);
pS[ClientArmour] == 75.0000
pS[Armour] == 0.0000
And kicked...
So the problem is that sa-mp doesn't really see immediately that a player has get health or armour, but it takes like
0.5 seconds.... And thats a kind of fail...
Question is, is this true or is it me that is doing something wrong?
Re: SetPlayerHealth/Armour GetplayerHealth/Armour fails? - [L3th4l] - 23.03.2011
Is not you. I think leong(some #s here) reported this problem a while ago. I'm not sure if it also applies to your problem, but you should check the bug report section.
Re: SetPlayerHealth/Armour GetplayerHealth/Armour fails? -
KaleOtter - 23.03.2011
Yea well, I already found a solution, I just enable a timer every time a player's armour or health has been set, and untill the timer isn't fininshed the server doesn't check for cheats at the player.
And it works so far I tested it.
But thanks for your answer, now i know that it's not by me