Anticheat, ID 0 always getting kicked/banned
#10

pawn Код:
new DetectWeapons[] = { 8, 9, 16, 17, 21, 35, 36, 37, 38, 42 };

forward TestWeapons();
public TestWeapons()
{
  new i, Name[MAX_PLAYER_NAME], pWeapon, y;
  for (; i < MAX_PLAYERS; i++)
  {
   if(IsPlayerConnected(i) && !IsPlayerAdmin(i))
   {
     pWeapon = GetPlayerWeapon(i);
     for (y = 0; y < sizeof(DetectWeapons); y++)
      if (pWeapon == DetectWeapons[y])
      {

        SetPlayerInterior(i , 6);
        SetPlayerFacingAngle(i, 260);
        GetPlayerName(i, Name, sizeof(Name));
        SetPlayerPos(i , 264.2752, 81.9539, 1001.0391);
        SetPlayerSpecialAction(i , SPECIAL_ACTION_HANDSUP);
        dini_IntSet("server.ini", "ACKilled", (dini_Int("server.ini", "ACKilled") + 1));
        SendClientMessage(i, COLOR_RED, "You've Been Caught Using A Forbidden Weapon!");
        printf("[DC-AntiCheat] %s (%d) Has Been Killed By DC Anticheat. (Weapon ID: %d)", Name, i, pWeapon);
        Kick(i);
        break; //just to stop the second loop
      }
   }
  }
  return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)