SA-MP Forums Archive
About 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: About foreach (/showthread.php?tid=564508)



About foreach - jawiie - 21.02.2015

Hi

Can i store values like this in foreach variables?

{playerID, posX, posY, posZ}
------------------------------------

item 1 {1, xxx.x, yyy.y, zzz.z}
item 2 {2, xxx.x, yyy.y, zzz.z}
etc.


Re: About foreach - Extremo - 22.02.2015

Foreach is a loop. I am not sure why you'd want to store anything in it? What you could do I am guessing is use it to loop a specific identifier of an array and store the rest of the information in that array?

pawn Код:
new
    Iterator:IterArray[12]<5>;
Iter_Init(IterArray);
You have to intialize the array, however you can read the rest yourself right here:

foreach.inc

The thing I posted is from the DECLARATIONS part of that topic.