Help with foreach
#1

I have foreach include defined:
Код:
#include <foreach>
Then I have error on this:
Код:
foreach(Petla, i)
Код:
(24) : error 017: undefined symbol "YSI_gPetlaS"
(24) : error 017: undefined symbol "YSI_gPetlaA"
(24) : warning 215: expression has no effect
(24) : error 001: expected token: ";", but found "]"
(24) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

ForEach(Petla, i);

But I suggest ForEach(player, i); if you want to use it as a playerid.
Reply
#3

start by ending your line with... ';' as usual.

Might wanne add a link to this foreach include as well, and if released in a topic, start searching for errors there...
Reply
#4

Still same error. I have ; there.
Reply
#5

What is 'Petla' ?
Reply
#6

YEs,what is petla?
The using of foreach is only
foreach(playerid, i)

you could also use petla if you do this

new petla = GetPlayerID(playerid);
Reply
#7

Quote:
Originally Posted by SkizzoTrick
Посмотреть сообщение
YEs,what is petla?
The using of foreach is only
foreach(playerid, i)

you could also use petla if you do this

new petla = GetPlayerID(playerid);
That's a false statement,
you can create your own iterators, if it would be only Player, i would say it would be useless


Код:
new Iterator:Petla<MAX>;
Do you have the iterator created?
Reply
#8

Quote:
Originally Posted by armyoftwo
Посмотреть сообщение
That's a false statement,
you can create your own iterators, if it would be only Player, i would say it would be useless


Код:
new Iterator:Petla<MAX>;
Do you have the iterator created?
My bad man,sorry,i just copied his post
I wanted to use write
foreach(playerid,i)

My bad
Reply
#9

Код:
(24) : error 017: undefined symbol "YSI_gplayeridS"
(24) : error 017: undefined symbol "YSI_gplayeridA"
(24) : warning 215: expression has no effect
(24) : error 001: expected token: ";", but found "]"
(24) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Код:
foreach(playerid, i);
uhm, I have so bad feeling that I have some old include
Reply
#10

Quote:
Originally Posted by Biesmen
Посмотреть сообщение
ForEach(Petla, i);

But I suggest ForEach(player, i); if you want to use it as a playerid.
^ that. Use it, for sake. Then post again.

if you use playerid at 'ForEach' it won't work, ofcourse -.-
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)