25.07.2015, 11:48
(
Последний раз редактировалось M4D; 25.07.2015 в 12:34.
)
Anti health hack:
simply, make server-sided health
how ?
just define a new variable and store player health into it.
set a 1 second repeating timer and check if player health is higher than variable value, he is using health hack
if not, set variable value to new player health
a quick example for my explains
a repeating timer Call "AntiCheat" callback every 1 or 2 second
it's better to use "foreach" instead of "for" loop
simply, make server-sided health
how ?
just define a new variable and store player health into it.
set a 1 second repeating timer and check if player health is higher than variable value, he is using health hack
if not, set variable value to new player health
a quick example for my explains
Код:
new Float:PlayerHealth[MAX_PLAYERS]; SetPlayerHealthEx(playerid, Float:hp) { PlayerHealth[playerid] = hp; return SetPlayerHealth(playerid, hp); } public AntiCheat() { for(new i; i < MAX_PLAYERS; i++) { new Float:health; GetPlayerHealth(i, health); if(health > PlayerHealth[i]) { //Player Using Health Hack } else { //>Player Health decreased, lets set variable value to new health PlayerHealth[i] = health; } } return 1; }
it's better to use "foreach" instead of "for" loop