11.01.2015, 15:40
Hi, i need help with looping arrays.
So when i have 50 Objects and i want to do like this:
And Later i want
So it's very boring and can i use loop to do this?
So when i have 50 Objects and i want to do like this:
pawn Code:
Object[0] = CreateObject...
...
...
Object[50] = CreateObject...
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]);
}