[Include] foreach 0.4.1 standalone include
#1

https://github.com/karimcambridge/SAMP-foreach/releases

I told ****** that I would maintain this old standalone version and he was OK with it.

Major changes in 19:

0.4.3

Code:
Iterators are now default set to ITER_NONE (-1), because in this version, an iterator can only hold 0 - size.
Added Iter_Finish and Iter_Previous marcos.
Remove \n at the end of the file.
Removed Iter_Debug & Iter_ShowArray (unused / disabled).
Remove space on function declarations.
foreach: clear each iterator under OnFilterScriptInit/OnGameModeInit.
Added a revised Iter_SafeRemoveInternal (ZiGGi).
Fix tags (ZiGGi).
Fix some grammar issue with spaces.
0.4.2

Code:
Code cleanup (renamed all Itter_ to Iter and removed excess).
Removed unnecessary information.
As I don't like how the newer foreach versions require YSI, this is the only one that I use.

This foreach 19 now replicas y_iterate at version 19.
Reply
#2

y_commands for standalone version pls, that would be nice haha
Reply
#3

great!

I was starting to think no one was actually going to re-release some kind of edit of ******'s work.
Reply
#4

Quote:
Originally Posted by lukewid
View Post
great!

I was starting to think no one was actually going to re-release some kind of edit of ******'s work.
Trust me you're wrong. You're gonna see YSI somewhere soon.

Plus, Kar, you didn't need his permission. Look at the license.
Reply
#5

I don't see why you are releasing a standalone version of foreach?

YSI don't even use memory hacking and as well y_iterate. So you can still continue using it with SAMP client updates.
Quote:

Code cleanup (remove all Itter_)

Itter_ functions are most important and useful part of foreach though!

@RaeF: whats wrong using y_commands include from YSI itself?
Reply
#6

The latest foreach required YSI.

Itter is spelt in correctly, they are now named Iter.
Reply
#7

Quote:
Originally Posted by Kar
View Post
The latest foreach required YSI.

Itter is spelt in correctly, they are now named Iter.
Actually foreach has always been YSI. Foreach was like a chalkboard compared to it's upgrade - the whiteboard, y_iterate.

And @Gammix: LOL. Itter was just a misspelling that has been fixed for a few months.
Reply
#8

Quote:
Originally Posted by Crayder
View Post
Actually foreach has always been YSI. Foreach was like a chalkboard compared to it's upgrade - the whiteboard, y_iterate.
Okay.

foreach has a version which does NOT require YSI. Which is THIS version.

The foreach 0.3 compatible thread was the STANDALONE version.

There was always 2 versions of foreach, a y_iterate version and foreach.inc.

You guys are probably too new here to realize it.

Why are you guys complaining.. I have done nothing wrong....

21/08/09:
Updated to include random functions.
Made entirely stand alone.
Ported to 0.3 (separate version).
Added automatic callback hook code.
Removed debug information from stand alone version.
06/01/08:
Added debug information.
09/10/07:
Moved to system.
16/09/07:
Added list sorting.
Made this part of Y SeRver Includes, not Y Sever Includes.
Made list sorting optional.
Fixed version number.
08/09/07:
First version.
Reply
#9

Thanks for re-posting this. It's great that everyone is starting to post his work again, since a lot of people rely on it for their projects.
Reply
#10

Quote:
Originally Posted by Kar
View Post
Why are you guys complaining.. I have done nothing wrong....
How was I complaining? I was merely stating something. Y_Iterate was built off of foreach (mostly) so therefore foreach has been part of YSI. I didn't say you did anything wrong!
Reply
#11

Good job releasing this as a standalone include again, - I hate how YSI dominates everything ****** produced, it's nice to see something he didn't force people into using with YSI still being worked on.
Reply
#12

Quote:
Originally Posted by Abagail
Посмотреть сообщение
Good job releasing this as a standalone include again, - I hate how YSI dominates everything ****** produced, it's nice to see something he didn't force people into using with YSI still being worked on.
This is the same thing I wanted to say lol
Reply
#13

What's the proper way to use this version of foreach?

Код:
foreach(new playerid : Player)

or 

foreach(Vehicle, i)
What's the correct syntax of this version?

Sorry for the dumb question, I'm just updating my server includes...
Reply
#14

Quote:
Originally Posted by ipsLeon
Посмотреть сообщение
What's the proper way to use this version of foreach?

Код:
foreach(new playerid : Player)

or 

foreach(Vehicle, i)
What's the correct syntax of this version?

Sorry for the dumb question, I'm just updating my server includes...
It uses the new syntax. The latest version (which must have YSI) is still the best though.
Reply
#15

Quote:
Originally Posted by Crayder
Посмотреть сообщение
It uses the new syntax. The latest version (which must have YSI) is still the best though.
I'm getting this weird error when compiling with this syntax (not sure if it's the new or old):


Код:
                       foreach(new i : Vehicle)
				{
					static Float:vehPos[3];
					GetVehiclePos(i, vehPos[0], vehPos[1], vehPos[2]);
					if(distance(vehPos[0], vehPos[1], vehPos[2], x2, y2, z2) < 7.0) 	return false;
			
				}
Код:
error 017: undefined symbol "Vehicle@YSII_Ag"
Am I using a wrong syntax?
Reply
#16

Did you create the Vehicle iter?
Reply
#17

Vehicle isn't pre-defined with the new syntax, though Player is. That error means the iter doesn't exist in the current context.
Reply
#18

Quote:
Originally Posted by Kar
Посмотреть сообщение
Did you create the Vehicle iter?
I didn't, sorry.
Reply
#19

Quote:
Originally Posted by Abagail
Посмотреть сообщение
Vehicle isn't pre-defined with the new syntax, though Player is. That error means the iter doesn't exist in the current context.
Yes it is pre-defined, but not in this old standalone.

Quote:
Originally Posted by Kar
Посмотреть сообщение
Did you create the Vehicle iter?
Quote:
Originally Posted by ipsLeon
Посмотреть сообщение
I didn't, sorry.
The vehicle iterator is only in the YSI library version.
Reply
#20

Good Job
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)