Weapon Anti-Cheat failure
#1

I really think GetPlayerWeapon is screwed up, or very inaccurate.

It always thinks players which are only just connecting have miniguns.

pawn Код:
new reason = GetPlayerWeapon(i);
                if(reason == 16||reason==35||reason==36||reason==37||reason==38 && IsPlayerConnected(i))
                {
                    format(msg,sizeof(msg),"Weapon hacks (%s)", WeaponName(reason));
                    BanUser2(i, msg, anticheatname);
                }
Does anyone know how to check if the player is .. i'm not sure, validly spawned. It bans them almost instantly after connecting.
Reply
#2

pawn Код:
public OnPlayerSpawn(playerid)
{
   SetPVarInt(playerid,"Spawned",true);
}
public OnPlayerDeath(playerid,playerid,killerid,reason)
{
   DeletePVar(playerid,"Spawned");
}

public OnPlayerUpdate(playerid)
{
  if(GetPVarInt(playerid,"Spawned"))
  {
     new reason = GetPlayerWeapon(playerid);
     if(reason == 16||reason==35||reason==36||reason==37||reason==38)
     {
                    format(msg,sizeof(msg),"Weapon hacks (%s)", WeaponName(reason));
                    BanUser2(playerid, msg, anticheatname);
     }
   }
   return 1;
}
im not sure if that will fix ur problem, but it check for weapons only if the player is spawned
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)