converting to foreach
#1

How do i convert this:
pawn Код:
for(new i=0; i < sizeof(ZoneInfo); i++)
into a foreach line?
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=157200
Reply
#3

You should not use foreach if you want to loop through all elements
foreach is there if you want to loop through parts of all available slots
As example if you want to loop only through the 20 connected players not through all 500 slots

But it seems that your code should loop through all elements
Reply
#4

I rather have it explained than getting an url with someone who doesnt solve the problem..
Edit: Got it
Reply
#5

We rather have people search the forums before posting a new thread that has been posted before as well, but that's not gonna happen either.
Reply
#6

Owned. ^^

I don't really use foreach for things other than player looping.
The thread really explains it clearly, more than most other people can.
Reply
#7

Quote:
Originally Posted by Pangea
Посмотреть сообщение
We rather have people search the forums before posting a new thread that has been posted before as well, but that's not gonna happen either.
Yeah but posting an url with the same problem, with no sullotion isnt very smart.. duh.
Reply
#8

Looked more carefully now. Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)