error 017: undefined symbol foreach - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: error 017: undefined symbol foreach (
/showthread.php?tid=542532)
error 017: undefined symbol foreach -
alexanderjb918 - 19.10.2014
D:\fcvrp\newupdate.pwn(810) : warning 201: redefinition of constant/macro (symbol "COLOR_ORANGE")
D:\fcvrp\newupdate.pwn(45457) : error 017: undefined symbol "foreach"
D:\fcvrp\newupdate.pwn(45457) : error 029: invalid expression, assumed zero
D:\fcvrp\newupdate.pwn(45457) : error 017: undefined symbol "i"
D:\fcvrp\newupdate.pwn(45457) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Код:
CMD:runplate(playerid, params[])
{
new member = PlayerInfo[playerid][pMember],
rank = PlayerInfo[playerid][pRank],
division = PlayerInfo[playerid][pDivision];
if(member == 1 && rank >= 4 || member == 1 && division == 6 || member == 18 && rank >= 3)
{
if(IsPlayerInAnyVehicle(playerid))
{
//if(GetPVarInt(playerid, "runningRadar") == 0) { return 1; }
new vehid = GetPlayerVehicleID(playerid),
szMessage[158];
/*if(CheckingSpeed[vehid] == 0)
{
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "The radar is turned off.");
return 1;
}*/
new id = GetVehicleInfront(vehid);
if(id != INVALID_VEHICLE_ID)
{
foreach(new i : Player)
{
new v = GetPlayerVehicle(i, id);
if(v != -1)
{
new string[78 + MAX_PLAYER_NAME], cext[32];
if(PlayerVehicleInfo[i][v][pvInsurance] == 1) { cext = "Valid"; } else { cext = "Invalid"; }
format(string, sizeof(string), "Vehicle registration: %d | Make/Model: %s | Owner: %s | Insurance: %s",id,GetVehicleName(PlayerVehicleInfo[i][v][pvId]),GetPlayerNameEx(i),cext);
SendClientMessageEx(playerid, COLOR_WHITE, string);
return 1;
}
}
for(new f = 0; f < MAX_FAMILY; f++)
{
new v = GetGangVehicle(f, id);
if(v != -1)
{
new string[72 + MAX_PLAYER_NAME];
format(string, sizeof(string), "Vehicle registration: %d | Make/Model: %s | Family Owner: %s",id,GetVehicleName(FamilyVehicleInfo[f][v][fvId]), FamilyInfo[f][FamilyLeader]);
SendClientMessageEx(playerid, COLOR_WHITE, string);
return 1;
}
}
SendClientMessageEx(playerid, COLOR_GRAD2, "This vehicle does not have any registration!");
}
format(szMessage, sizeof(szMessage), "* %s runs the plate of the vehicle infront of him on the MDC.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
else
{
SendClientMessageEx(playerid, COLOR_LIGHTRED, "You are not authorized to use this command");
return 1;
}
return 1;
}
AW: error 017: undefined symbol foreach -
Skimmer - 19.10.2014
You don't have foreach include.
You can get it from here...
https://sampforum.blast.hk/showthread.php?tid=92679
... or you just change this line
to
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
Re: error 017: undefined symbol foreach -
alexanderjb918 - 19.10.2014
Yea i figured it out, resolved thanks for assisting me