13.04.2017, 21:26
I fixed it by making this function:
Use:
PHP код:
#define Iter_Index(%1,%2) Itter_Index(_Y_ITER_ARRAY:%1@YSII_Ag,%2,_Y_ITER_ARRAY_SIZE(%1))
stock Itter_Index(array[], index, size)
{
new cont = 0,
last = size,
next = array[last];
while(cont < index)
{
last = next;
next = array[last];
cont++;
}
return next;
}
PHP код:
new value = Iter_Index(IteratorName, index);
PHP код:
new Iterator:test<5>;
Iter_Add(test, 4);
Iter_Add(test, 0);
Iter_Add(test, 2);
Iter_Index(test, 1); // return 2 as the array will be ordered in ascendent order