Posts: 89
Threads: 27
Joined: Jan 2011
Reputation:
0
As most of you know GetPlayerHealth() is called before SetPlayerHealth() even though it should be called before GetPlayerHealth() in the script.
So my question is in order to realise a nice Anti-Hack System what is required to actually call GetPlayerHealth() after SetPlayerHealth() to avoid wrong hack-warnings?
Posts: 89
Threads: 27
Joined: Jan 2011
Reputation:
0
"wait for it to sync and then monitor it for changes"
How would you wait for it to 'sync'?
Posts: 1,046
Threads: 29
Joined: Mar 2010
Wait for the next player update. You can't simply get the new health right after you have changed it using SetPlayerHealth. A player update tells you, if the player has synced its new health with the server. A cheater can freely ignore SetPlayerHealth.
Posts: 7,801
Threads: 187
Joined: Feb 2010
Reputation:
0
OnPlayerUpdate is basically the client's response to something from the server. If you "SetPlayerHealth" somewhere, OnPlayerUpdate is going to be called once the client "syncs" with that health that you've just set (usually this is instantaneous).
Hackers, on the other hand, won't really respond to "SetPlayerHealth". So if you "SetPlayerHealth(playerid, 90.0);" and the client's health is still (for example) 100, then obviously either one of two things are wrong...
1. There's latency between the client and the server. In this case, check for a high ping. If the ping is below 300, they probably aren't lagging.
2. They are hacking and you should ban them.
Posts: 481
Threads: 19
Joined: Feb 2012
Ye ban him but here are any things u should know example clients-server pickups..machines shops.. Example i removed machines removed shops or pickups but im always fear of ban player if hes health hacking or not