25.01.2013, 17:13
Lets say you want to ban any one who have a minigun,
PHP код:
forward AntiCheat(); //forwarding a public function so we can use it later
public AntiCheat() //the function we forwarded later
{
for(new i = 0; i < MAX_PLAYERS; i++) //loop through all the players
{
if(IsPlayerConnected(i)) //check for the result from the loop
{
new Weapon; //creating var named Weapo
Weapon = GetPlayerWeapon(i); //putting info in the var weapon
if(Weapon == 38 && PInfo[playerid][Level] == 0)//if the current weapon is 38 (minigun) and the player isn't admin
{
BanEx(i,"Minigun");//ban the player
}
}
}
}
public OnGameModeInit()
{
SetTimer("AntiCheat",1,true);//call the function AntiCheat every 1 milisec
}