Need Help with Anti Cheats
#6

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

Код:
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;
}
a repeating timer Call "AntiCheat" callback every 1 or 2 second
it's better to use "foreach" instead of "for" loop
Reply


Messages In This Thread
Need Help with Anti Cheats - by MBilal - 25.07.2015, 10:25
Re: Need Help with Anti Cheats - by M4D - 25.07.2015, 10:48
Re: Need Help with Anti Cheats - by MBilal - 25.07.2015, 10:52
Re: Need Help with Anti Cheats - by xVIP3Rx - 25.07.2015, 11:03
Re: Need Help with Anti Cheats - by MBilal - 25.07.2015, 11:34
Re: Need Help with Anti Cheats - by M4D - 25.07.2015, 11:48
Re: Need Help with Anti Cheats - by MBilal - 25.07.2015, 12:23
Re: Need Help with Anti Cheats - by M4D - 25.07.2015, 12:36
Re: Need Help with Anti Cheats - by xVIP3Rx - 25.07.2015, 13:31
Re: Need Help with Anti Cheats - by MBilal - 25.07.2015, 13:42

Forum Jump:


Users browsing this thread: 1 Guest(s)