06.09.2009, 20:44
A little more optimized
pawn Код:
forward timer();
public timer()
{
for(new a=0; a<MAX_PLAYERS; a++)
{
if(!IsPlayerConnected(a)) continue;
if(!IsPlayerInAnyVehicle(a)) continue;
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);
continue;
}
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;
}