Array loop
#1

Hi, i need help with looping arrays.
So when i have 50 Objects and i want to do like this:
pawn Code:
Object[0] = CreateObject...
...
...
Object[50] = CreateObject...
And Later i want
pawn Code:
if(IsPlayerInRangeOfPoint(i, 1, ObjectX[0], ObjectY[0], ObjectZ[0]))
{
     DestroyObject(Object[0]);
}
else if(IsPlayerInRangeOfPoint(i, 1, ObjectX[1], ObjectY[1], ObjectZ[1]))
{
     DestroyObject(Object[1]);
}
..
..
..
else if(IsPlayerInRangeOfPoint(i, 1, ObjectX[50], ObjectY[50], ObjectZ[50]))
{
     DestroyObject(Object[50]);
}
So it's very boring and can i use loop to do this?
Reply


Messages In This Thread
Array loop - by finelaq - 11.01.2015, 15:40
Re: Array loop - by Divergent - 11.01.2015, 16:10

Forum Jump:


Users browsing this thread: 2 Guest(s)