Variable [index]
#1

Hi, i have this variables :
pawn Код:
new barrel[14];
barrel[0] = CreateDynamicObject(1225, -1406.53, 986.81, 1023.33,   0.00, 0.00, 0.00);
....
barrel[13] = CreateDynamicObject(1225, -1377.71, 990.16, 1023.29,   0.00, 0.00, 0.00);
And, how i can do simply this like :
pawn Код:
DestroyObject(barrel[index]);
barrel[index] = CreateObject()
Reply
#2

Do you mean loops? If so, then it will be like this:
pawn Код:
for(new index; index < 14; index++)
{
    DestroyObject(barrel[index]);
    barrel[index] = CreateObject(...);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)