[SOLVED]anti hack banning sometimes people that join the server ;s
#1

I always thought that players were weapon hacking in the server... but yesterday it happend to me. I joined server "Connected blablalbla" en 1 sec later Server closed the connection...
My m8 was in so he told me i was banned for weapon hacking... it happens now and then. This is the code:
pawn Код:
public AntiWeaponHack()
{
new string[128], tmpname[MAX_PLAYER_NAME];
for (new i = 0; i < MAX_PLAYERS; i++)
{
  switch(GetPlayerWeapon(i))
  {
    case 9, 11, 12, 13, 17, 36, 37, 38, 39, 40, 42, 41, 43, 44, 45, 47:
    {
      GetPlayerName(i, tmpname, sizeof(tmpname));
      format(string, sizeof(string), "[ANTI-CHEAT] %s has been auto-banned for Weapon Hacking.", tmpname);
      SendClientMessageToAll(GAME_ENGINE, string);
      print(string);
          BanEx(i, weapon);
    }
  }
}

return 1;
}
I hope somebody can help me fixing this.
Reply
#2

bump
Reply
#3

at the top
pawn Код:
new PlayerSpawned[MAX_PLAYERS];
OnPlayerSpawn
pawn Код:
PlayerSpawned[playerid] = 1;
OnPlayerConnect
pawn Код:
PlayerSpawned[playerid] = 0;
pawn Код:
public AntiWeaponHack()
{
new string[128], tmpname[MAX_PLAYER_NAME];
for (new i = 0; i < MAX_PLAYERS; i++)
{
  switch(GetPlayerWeapon(i))
  {
    case 9, 11, 12, 13, 17, 36, 37, 38, 39, 40, 42, 41, 43, 44, 45, 47:
    {
      if(PlayerSpawned[playerid]==1)
{
      GetPlayerName(i, tmpname, sizeof(tmpname));
      format(string, sizeof(string), "[ANTI-CHEAT] %s has been auto-banned for Weapon Hacking.", tmpname);
      SendClientMessageToAll(GAME_ENGINE, string);
      print(string);
          BanEx(i, weapon);
}
    }
  }
}

return 1;
}
UNTESTED!
Reply
#4

Thanks... not sure if it's working to but we have to wait...
Reply
#5

Quote:
Originally Posted by `FuTuRe-
Thanks... not sure if it's working to but we have to wait...
That should work,it won't kick him if the player is not spawned.
The player can not use weapon cheats if he is not spawned,i mean
the weapons will not be spawned if the player is not spawned.
Reply
#6

It's not banning weapon hackers anymore.
Reply
#7

Quote:
Originally Posted by `FuTuRe-
It's not banning weapon hackers anymore.
What do you mean? even if they cheat?
Reply
#8

Yes. someone just had a minigun. then some heat seaking rockets. he didn't got banned by the system.
Reply
#9

Where are you using that callback? (timer, OnPlayerUpdate, etc).
Reply
#10

You would need a timer for that function to work properly.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)