no I just snipped that out of the code. The first few doesn't have the error. This is my whole code:
pawn Код:
forward AntiCheat();
public AntiCheat()
{
new weap, ammo;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && ADMIN[i] == 0)
{
GetPlayerWeaponData(i, 7, weap, ammo); //This is the only one taht does not give a error
if(ammo > 1 && weap == 35)
{
new string [128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(i, pName, sizeof(pName));
format(string, sizeof(string), "BANNED: %s has been auto banned by console. [Heat Seaking Missle]", pName);
SendClientMessageToAll(COLOR_RED, string);
printf(string);
GetPlayerName(i, pName, sizeof(pName));
BanEx(i, "%s has been auto banned by console. [Heat Seaking Missle]");
}
GetPlayerWeaponData(i, 7, weap, ammo); //Need to define this for each cause the weapon slot changes.
else if(ammo > 1 && weap == 36 && MISSLE36[i] == false) //Error
{
new string [128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(i, pName, sizeof(pName));
format(string, sizeof(string), "BANNED: %s has been auto banned by console. [Missle Launcher]", pName);
SendClientMessageToAll(COLOR_RED, string);
printf(string);
GetPlayerName(i, pName, sizeof(pName));
BanEx(i, "%s has been auto banned by console. [Missle Launcher]");
}
GetPlayerWeaponData(i, 7, weap, ammo); //Flame Thrower
else if(FLAME37[i] == false && ammo > 1 && weap == 37) //Error
{
new string [128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(i, pName, sizeof(pName));
format(string, sizeof(string), "BANNED: %s has been auto banned by console. [Flame Thrower]", pName);
SendClientMessageToAll(COLOR_RED, string);
printf(string);
GetPlayerName(i, pName, sizeof(pName));
BanEx(i, "%s has been auto banned by console. [Flame Thrower]");
}
GetPlayerWeaponData(i, 7, weap, ammo); //Minigun
else if(MINI38[i] == false && ammo > 1 && weap == 38) //Error
{
new string [128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(i, pName, sizeof(pName));
format(string, sizeof(string), "BANNED: %s has been auto banned by console. [Minigun]", pName);
SendClientMessageToAll(COLOR_RED, string);
printf(string);
GetPlayerName(i, pName, sizeof(pName));
BanEx(i, "%s has been auto banned by console. [Minigun]");
}
GetPlayerWeaponData(i, 11, weap, ammo); //Error
else if(ammo > 1 && weap == 44) //Night Vision
{
new string [128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(i, pName, sizeof(pName));
format(string, sizeof(string), "BANNED: %s has been auto banned by console. [Night Vision]", pName);
SendClientMessageToAll(COLOR_RED, string);
printf(string);
GetPlayerName(i, pName, sizeof(pName));
BanEx(i, "%s has been auto banned by console. [Night Vision]");
}
GetPlayerWeaponData(i, 11, weap, ammo); //Error
else if(ammo > 1 && weap == 45) //Thermal Goggles
{
new string [128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(i, pName, sizeof(pName));
format(string, sizeof(string), "BANNED: %s has been auto banned by console. [Thermal Vision]", pName);
SendClientMessageToAll(COLOR_RED, string);
printf(string);
GetPlayerName(i, pName, sizeof(pName));
BanEx(i, "%s has been auto banned by console. [Thermal Vision]");
}
}
}
return 1;
}