02.02.2014, 00:16
I get this error on my command!?
The error line is the one with foreach..
And yes I do have it included on the top
Код:
C:\Users\Namn\Desktop\-NLG-\gamemodes\zcmd_test.pwn(5223) : error 017: undefined symbol "foreach" C:\Users\Namn\Desktop\-NLG-\gamemodes\zcmd_test.pwn(5223) : error 029: invalid expression, assumed zero C:\Users\Namn\Desktop\-NLG-\gamemodes\zcmd_test.pwn(5223) : error 017: undefined symbol "i" C:\Users\Namn\Desktop\-NLG-\gamemodes\zcmd_test.pwn(5223) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
pawn Код:
CMD:friskhouse(playerid, params[])
{
new string2[128], string3[128], string4[128], string5[128];
if(IsPlayerConnected(playerid))
{
if (IsACop(playerid) || IsAnFbi(playerid) || IsAnNg(playerid))
{
foreach (new i : Player)
{
new house = HouseEntered[playerid];
new gunname1[24];
GetWeaponName(HouseInfo[house][hWeapon1],gunname1, sizeof(gunname1));
new gunname2[24];
GetWeaponName(HouseInfo[house][hWeapon2],gunname2, sizeof(gunname2));
new gunname3[24];
GetWeaponName(HouseInfo[house][hWeapon3],gunname3, sizeof(gunname3));
new gunname4[24];
GetWeaponName(HouseInfo[house][hWeapon4],gunname4, sizeof(gunname4));
if(IsPlayerInRangeOfPoint(playerid, 15, HouseInfo[house][hExitx],HouseInfo[house][hExity],HouseInfo[house][hExitz]))
{
format(string, sizeof(string),"-HOUSE STORAGE- Suspected have %d Drugs and %d Materials.",HouseInfo[house][hDrugs],HouseInfo[house][hMaterials]);
SCM(playerid, COLOR_GREY,string);
format(string2, sizeof(string2),"-HOUSE STORAGE- Weapon 1 - %s Ammo: %d.",gunname1,HouseInfo[house][hAmmo1]);
SCM(playerid, COLOR_GREY,string2);
format(string3, sizeof(string3),"-HOUSE STORAGE- Weapon 2 - %s Ammo: %d.",gunname2,HouseInfo[house][hAmmo2]);
SCM(playerid, COLOR_GREY,string3);
format(string4, sizeof(string4),"-HOUSE STORAGE- Weapon 3 - %s Ammo: %d.",gunname3,HouseInfo[house][hAmmo3]);
SCM(playerid, COLOR_GREY,string4);
format(string5, sizeof(string5),"-HOUSE STORAGE- Weapon 4 - %s Ammo: %d.",gunname4,HouseInfo[house][hAmmo4]);
SCM(playerid, COLOR_GREY,string5);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /friskhouse",d,m,y,h,mi,s,sendername);
CommandLog(string);
}
}
}
else return SCM(playerid, COLOR_GREY, "You are not a Law member!");
}
else return SCM(playerid, COLOR_GREY,"You need to be connected to use this command");
}