Anti cheat help
#1

Im working on an anti cheat but it bans my admins -.- how do i make a whitelist? to where it wont ban them
Reply
#2

Just check that the players you are banning are not admins using your releveant variable.
Reply
#3

Ya. If it about weapons, add just the names you dont want:
pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(strcmp(name, "NAME_HERE", true)) return false; // 1 name example
// Other names
else... // Otherwise, will work normally
// Ban code.
Reply
#4

Best if you make your own admin system, (Some people think admin system is hard to make, i thought so but it is like making a gang team of a law team just admin team)

pawn Код:
public OnPlayerUpdate(playerid)
{
    new weps = GetPlayerWeapon(playerid);
    if(IsAdmin[playerid] != 1)//Substitute this for your variable you use to check if the player is admin.
    {
        if(weps == 35 || weps == 36 || weps == 37 || weps == 38 || weps == 39 || weps == 40 || weps == 44 || weps == 45)//All these are some of the weapons you will want to ban for.
        {
            GetPlayerName(playerid,Name,sizeof(Name));
            format(String,sizeof(String),"%s has been banned from the server. Reason: Weapon Hacks.",Name);
            SendClientMessageToAll(0xFF0000FF,String);
            Ban(playerid);
        }
        return 1;
    }
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)