anti cheat not working,
#1

When someone used a minigun and rocket launcher he didn't got banned ;(
Anyone knows the reason?
pawn Код:
public AntiHackCheat()
{
    new string[128];
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
            switch(GetPlayerWeapon(i))
            {
                case 9, 17, 36, 37, 38, 39, 40, 42, 44, 45, 47:
                {
                  new killer[MAX_PLAYER_NAME];
                  GetPlayerName(i, killer, sizeof(killer));
                    if(GetPlayerWeapon(i) == 18)
                    {
                        format(string, sizeof(string), "[ANTI-CHEAT] %s was banned, Reason: [WEAPON HACKING]", killer);
                    }
                  else
                  {
                    format(string, sizeof(string), "[ANTI-CHEAT]: %s was banned, Reason: [WEAPON HACKING]", killer);
                  }
                  SendClientMessageToAll(GAME_ENGINE, string);
                  printf("[ANTI-CHEAT] %s has just been banned, defined Reason: [WEAPON HACKING]", killer);
                  Ban(i);
                }
            }
            }
    return 1;
}
Reply
#2

I think you need a timer that loops that public (checks)
Reply
#3

That's messy as hell.

pawn Код:
public AntiHackCheat()
{
    new string[128], tmpname[MAX_PLAYER_NAME];
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
      switch(GetPlayerWeapon(i))
      {
        case 9, 17, 36, 37, 38, 35, 39, 40, 42, 44, 45, 47:
        {
          GetPlayerName(i, tmpname, sizeof(tmpname));
          format(string, sizeof(string), "Hohoho, %s has been auto-banned for weapon hacking.", tmpname);
          SendClientMessageToAll(GAME_ENGINE, string);
          print(string); // I don't have a clue why you're printing a string that has already been formatted, and formatting it again in printf()
          Ban(i);
        }
      }
    }
   
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)