12.01.2011, 00:18
Im working on an anti cheat but it bans my admins -.- how do i make a whitelist? to where it wont ban them
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.
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;
}
}