Need Small help Rep +
#1

I'm trying to make anti cheat ,

Code:
OnPlayerTakeDamage
under
if(Armour==0)
{
               		        HH[playerid]++;
				switch(HH[playerid])
				{
				case 1:
				{
		        new Float:OldHealth[playerid];
				GetPlayerhealth(playerid,OldHealth[playerid]);
				}
				case 2:
				{
				new Float:newHealth[playerid];
				GetPlayerhealth(playerid,newHealth[playerid]);
				}
				case 3:
				{
				if(OldHealth[playerid]== newHealth[playerid])
				{
	//hacking ..
				}
				}
  }
}
I'm trying to detect health hack under OnPlayerDamage
Is i am doing right?
Reply
#2

you're in the right place "OnPlayerTakeDamage"
Reply
#3

Yep. Reply up if you got any errors.
Reply
#4

I convert code to this check this out?
Code:
                new Float:AR[MAX_PLAYERS];
                new HH[MAX_PLAYERS] ; new Float:OldHealth[MAX_PLAYERS];new Float:newHealth[MAX_PLAYERS];
                GetPlayerArmour(playerid,AR[playerid]);
                
                if(AR[playerid]==0)
                {
		        HH[playerid]++;
				if(HH[playerid]==1)
				{
				GetPlayerHealth(playerid,OldHealth[playerid]);
				}
				else if(HH[playerid]==2)
				{
				GetPlayerHealth(playerid,newHealth[playerid]);
				}
				else if(HH[playerid]==4)
				{
				if(OldHealth[playerid]== newHealth[playerid])
				{
				SCM(playerid,red,"Warning:Stop hacking.");
				Kick(playerid);
				}
				}
				}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)