Foreach error - 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: Foreach error (
/showthread.php?tid=454214)
Foreach error -
khazard - 28.07.2013
Код:
(5022) : error 017: undefined symbol "YSI_gnew"
(5022) : warning 215: expression has no effect
(5022) : error 001: expected token: ")", but found ";"
(5022) : error 036: empty statement
(5022) : fatal error 107: too many error messages on one line
Lines:
Код:
stock IsSeatAvailable(vehicleid, seat)
{
new carmodel = GetVehicleModel(vehicleid);
for (new i = 0; i < sizeof(OneSeatVehicles); i++)
{
if(carmodel == OneSeatVehicles[i]) return false;
}
foreach(new Player, i);
{
if(GetPlayerVehicleID(i) == vehicleid && GetPlayerVehicleSeat(i) == seat) return false;
}
return true;
}
How do i fix this error?
Allready tried to #define YSI_gnew...
Re: Foreach error -
PrinceKumar - 28.07.2013
Which is the line 5022 and after retun true have have close it with bracket }
Re: Foreach error -
SuperViper - 28.07.2013
without the semicolon at the end.
Re: Foreach error -
khazard - 28.07.2013
Did:
Код:
(5022) : error 017: undefined symbol "YSI_gnew"
(5022) : warning 215: expression has no effect
(5022) : error 001: expected token: ")", but found ";"
(5022) : error 036: empty statement
(5022) : fatal error 107: too many error messages on one line
Re: Foreach error -
khazard - 28.07.2013
When i change the line to: foreach(new i: Player) i get this:
Код:
H:\Script - kopie\gamemodes\HRP.pwn(5022) : error 017: undefined symbol "foreach"
H:\Script - kopie\gamemodes\HRP.pwn(5022) : error 029: invalid expression, assumed zero
H:\Script - kopie\gamemodes\HRP.pwn(5022) : error 017: undefined symbol "Player"
H:\Script - kopie\gamemodes\HRP.pwn(5022) : fatal error 107: too many error messages on one line
Re: Foreach error -
khazard - 28.07.2013
Quote:
Originally Posted by PrinceKumar
Which is the line 5022 and after retun true have have close it with bracket }
|
foreach(new Player, i);
Re: Foreach error -
Sublime - 28.07.2013
@******, you probably mean YSI/y_iterate, or..? I never saw foreach having a folder, except for having that pastebin.
Re: Foreach error -
khazard - 28.07.2013
Quote:
Originally Posted by ******
Do you have the latest version of foreach/y_iterate?
|
Yes,
Anyone else have a idea?
Re: Foreach error -
Necip - 28.07.2013
Do you have #include <foreach> at the top?
Re: Foreach error -
khazard - 28.07.2013
yes i have