[Include] foreach 0.4.1 standalone include
#41

Quote:
Originally Posted by Crayder
Посмотреть сообщение
Why would you remove NPC support? You added Actor support, but removed one of the main iterators. I use both, the "Character" and "Bot" iterators, so I'm not exactly a fan of this change...
You don't understand. I have removed NPC script support, this scripts located in npcmodes/ folder. Because I don't need this.

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
About the Vehicle iterator: it is for local vehicles, each script has each own vehicles not global (from all scripts).
If you could add both options would be nice.
I can fix it, will be soon.
Reply
#42

Quote:
Originally Posted by ZiGGi
Посмотреть сообщение
You don't understand. I have removed NPC script support, this scripts located in npcmodes/ folder. Because I don't need this.
Yeah, I noticed. I was on my phone when I said that before.

However... You removed the YSI communication. So now if someone uses YSI they will corrupt each other.
Reply
#43

Quote:
Originally Posted by Crayder
Посмотреть сообщение
However... You removed the YSI communication. So now if someone uses YSI they will corrupt each other.
Who uses YSI shouldn't use that.

Btw, fork are updated, multiscripts now supported by FOREACH_MULTISCRIPT define.
Reply
#44

Thnx for ur great include but i have one question
foreach function may be used as foreach(Player : i); only or i may use something like foreach(MAX_BANKS : i);
Reply
#45

Quote:
Originally Posted by KokyZ
Посмотреть сообщение
Thnx for ur great include but i have one question
foreach function may be used as foreach(Player : i); only or i may use something like foreach(MAX_BANKS : i);
Neither of them. The old (deprecated) syntax which you shouldn't use is somewhat similar to what you posted but the separator is different:
Код:
// DO NOT USE
foreach(Player, i)
The syntax you should be using is:
pawn Код:
// foreach(iterator_variable : iterator_name)
foreach(new i : Player)
It expects the name of the iterator and not a constant (assuming MAX_BANKS is one).
Quote:
Originally Posted by ZiGGi
Посмотреть сообщение
I can fix it, will be soon.
Thanks. Adding the feature for optimized multi-iterators would be great as well.
Reply
#46

EDIt: sorry posted by wrong iam so sorry
Reply
#47

I have a problem with this include.

when I'm using foreach(new playerid : Player) it doesn't include the player id 0.

Why?

I mean, it start counting from 1+..
Reply
#48

Quote:
Originally Posted by iSanchez
Посмотреть сообщение
I have a problem with this include.

when I'm using foreach(new playerid : Player) it doesn't include the player id 0.

Why?

I mean, it start counting from 1+..
Show some more code. Try it like this maybe,

Код:
foreach(new i : Player)
.
Reply
#49

Quote:
Originally Posted by iSanchez
Посмотреть сообщение
I have a problem with this include.

when I'm using foreach(new playerid : Player) it doesn't include the player id 0.

Why?

I mean, it start counting from 1+..
It's starts from the lowest playerid and goes through each other playerid. It's not like a foreach loop that loops through a range.
Reply
#50

Hey, is there way to access indexes of a foreach loop.

Lets say my iterator consists following elements:
PHP код:
524532763145924010
// total elements = 10 
Now i want the loop to start from 76 (i.e. 4th index), but is there any way other than using "continue" inside the loop?
Reply
#51

Add support for vehicles, good job.
Reply
#52

Update your foreach include.

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


Forum Jump:


Users browsing this thread: 1 Guest(s)