[HELP] Banning Players With Weapons
#4

Your code checks for people with weapons every second.

I added a second timer under your timer callback to check if they still have weapons after 10 seconds, if they do, it will ban them with a message:

pawn Код:
forward reset();
public reset()
{
    for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
    {
        ResetPlayerWeapons(playerid);
       
        SetTimerEx("WeaponBan",10000,false,"d",playerid);
    }
    return 1;
}

forward WeaponBan(playerid);
public WeaponBan(playerid)
{
    if(GetPlayerWeapon(playerid) != 0))
    {
        new string[128], name[24];
       
        GetPlayerName(playerid,name,24);
       
        format(string,128,"%s (%d) Has Been Automatically Banned For Weapon Hacks.",name,playerid);
        SendClientMessageToAll(-1,string);

        print(string);
       
        Ban(playerid);
       
        return 1;
    }
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)