foreach Problem - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: foreach Problem (
/showthread.php?tid=256588)
foreach Problem -
Gforcez - 21.05.2011
Hello I'm Working with foreach atm. But i have a little problem:
Look i have this:
pawn Код:
new Iterator:AllVehicles<MAX_VEHICLES>;
//(And in a Function:)
foreach(AllVehicles, i)
But it gives a Warning. And it doesn't work
Код:
warning 203: symbol is never used: "YSI_gCAllVehicles"
Does Somebody knows how to fix it.. So i can use foreach Properly!
Thanks,
Gforcez
Re: foreach Problem -
PhantomDot1 - 21.05.2011
in which callback is it, and in which function?
give the code, that makes it more clear
Re: foreach Problem -
Gforcez - 21.05.2011
Quote:
Originally Posted by PhantomDot1
in which callback is it, and in which function?
give the code, that makes it more clear
|
Its under OnGameModeInit:
Код:
foreach(AllVehicles, i)
{
VehicleStarted[i] = false;
VehicleFuel[i] = Standard_Fuel;
}
Re: foreach Problem - [L3th4l] - 21.05.2011
You have to add elements into it.
pawn Код:
Itter_Add(AllVehicles, 1);
If you don't know what this does, just make a simple loop.