SA-MP Forums Archive
How can I include forEach properly? - 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: How can I include forEach properly? (/showthread.php?tid=656061)



How can I include forEach properly? - Seifspeed - 06.07.2018

What is the difference between y_iterator and forEach. And how can I include it in my script?
Thanks in advance!


Re: How can I include forEach properly? - Calisthenics - 06.07.2018

y_iterate from YSI will always be up-to-date. The standalone version of foreach hasn't been updated for a long time.

This is how you install YSI 4:
Quote:
Originally Posted by Calisthenics
Посмотреть сообщение
To test YSI, I downloaded latest version: https://github.com/pawn-lang/YSI-Inc...rchive/4.x.zip
also amx_assembly: https://github.com/Zeex/amx_assembly/archive/master.zip
Extracted both.
Inside of folder "YSI-Includes-4.x", I created a new folder called "amx" and I placed all files from "amx_assembly-master" to "YSI-Includes-4.x\amx" folder.
Last, I moved all files and folders from "YSI-Includes-4.x" to pawno\include folder and that's it.

Now about including YSI libraries (say y_iterate), I use:
pawn Код:
#include <a_samp>
// YSI libraries after a_samp
#include <YSI\y_iterate>
// any other include
Using slash will fail, this will not work:
pawn Код:
#include <YSI/y_iterate>



Re: How can I include forEach properly? - CodeStyle175 - 06.07.2018

foreach works fine and doesn't need to updated and it doesnt require big libery of other useless things.


Re: How can I include forEach properly? - Calisthenics - 06.07.2018

Quote:
Originally Posted by CodeStyle175
Посмотреть сообщение
foreach works fine and doesn't need to updated and it doesnt require big libery of other useless things.
Then use the old method for 2D iterator that is A * B and not A + B. Because you want to use outdated includes, others should not do the same..

YSI is not like in the past that included many things along and had recursion. You include only y_iterate and that is it.


Re: How can I include forEach properly? - CodeStyle175 - 06.07.2018

idk what are you talking but this include https://sampforum.blast.hk/showthread.php?tid=570868 works fine.