Anti-cheat help :(
#1

Me any my friend are making an anti-cheat for his server but we dont seem to get much luck Basically nothing happens. we got health legally, nothing happened. We then got health illegally, nothing happened. Heres the code:

pawn Code:
public healthhackcheck()
{
  for (new i = 0; i < MAX_PLAYERS; i++)
    {
    new Float:fHealth;
      GetPlayerHealth(i, fHealth);
      if(fHealth != faPlayerHealth[i])
        {
        if(fHealth > faPlayerHealth[i])
        {
              if ( gainedhealth[i] == 0 ) {
                new string[200];
                new pname[200];
                GetPlayerName(i, pname, 24);
          format(string, 100, "**(AUTO BAN)** %s(%d) Health hacks detected", string,i);
          SendClientMessageToAll(0xFF7F50AA, string);
        }
        if(gainedhealth[i] == 1)
                {
                gainedhealth[i] =0;
                }
        }
        faPlayerHealth[i] = fHealth;
       }
     }
}
A timer is set at gamemodinit

pawn Code:
SetTimer("healthhackcheck",3000,0);
Everytime SetPlayerHealth is used, that variable "gainhealth" is set to 1
Reply


Messages In This Thread
Anti-cheat help :( - by viper_viper - 18.05.2009, 18:39
Re: Anti-cheat help :( - by FUNExtreme - 18.05.2009, 19:28
Re: Anti-cheat help :( - by viper_viper - 18.05.2009, 20:12

Forum Jump:


Users browsing this thread: 1 Guest(s)