06.09.2009, 16:13
This anti cheat seems to have a bug that i need ironing out with the help from you guys/girls.
I dont get any errors and it does work when a player has any weapon they get banned.
BUT for some reason when a player joins when someone has cheated and got banned, they are banned. I'm still a beginner at scripting so im not sure whats wrong. Please help me out.
I dont get any errors and it does work when a player has any weapon they get banned.
BUT for some reason when a player joins when someone has cheated and got banned, they are banned. I'm still a beginner at scripting so im not sure whats wrong. Please help me out.
pawn Код:
forward timer();
public timer()
{
for(new a=0; a<MAX_PLAYERS; a++)
{
if(IsPlayerConnected(a))
{
if(IsPlayerInAnyVehicle(a))
{
}
else if(GetPlayerWeapon(a) >= 1)
{
GetPlayerName(a,pname,MAX_PLAYER_NAME);
SendClientMessage(a,COLOR_RED,"You have been banned for weapon Cheats!");
Ban(a);
format(string,sizeof(string),"Player %s has been banned for using Cheats",pname);
SendClientMessageToAll(COLOR_RED,string);
return 1;
}
else
{
new Float:armour;
GetPlayerArmour(a, armour);
if(armour > 0.0)
{
SendClientMessage(a, COLOR_RED, "Armour is not allowed on this server");
GetPlayerName(a, pname, MAX_PLAYER_NAME);
Ban(a);
format(string,sizeof(string),"Player %s has been banned for Armour Cheats",pname);
SendClientMessageToAll(COLOR_RED,string);
}
}
}
}
return 1;
}