PDA

View Full Version : [Iterator] Is there a way to add a value which is more than the iter's size?


iSpark
02/07/2018, 09:12 PM
new Iterator:tots<5>;

Iter_Add(tots, 1);
Iter_Add(tots, 4);
Iter_Add(tots, 6);

foreach(new i: tots)
printf("%d", i);


Output

1
4


I need it such that I can add values outside of its size.

iSpark
02/07/2018, 09:15 PM
Nevermind. Found the answer.

http://forum.sa-mp.com/showthread.php?p=2554322#post2554322

Gr00t
02/07/2018, 10:37 PM
new Iterator:tots<5>;

Iter_Add(tots, 1);
Iter_Add(tots, 4);
Iter_Add(tots, 6);

foreach(new i: tots)
printf("%d", i);


Output

1
4


I need it such that I can add values outside of its size.

I think you have a wrong concept of how iterators works, you should read any tutorial
http://forum.sa-mp.com/showthread.php?t=571159