Need help from loop expert.

Here is the loop. I'm using an array for holding inventory. This loop is for turning on the icons in the menu.
I need it to first see if a specific inv (inventory) array is greater than 0, than if it is, then turn the visibility state to enable for the clone with the matching cloneindex (for whichever array is not empty).
Every time I try, I get a runtime error (the line with if(inv>0)[i] so it says). Does anyone know what I'm doing wrong?
- Code: Select all
int i;
for(i=0; i=7; i++)
{
if(inv[i]>0)
{ sprintf(astring, "w2.%i", i);//w2 is an actor.
VisibilityState(astring, ENABLE);
}
}
I need it to first see if a specific inv (inventory) array is greater than 0, than if it is, then turn the visibility state to enable for the clone with the matching cloneindex (for whichever array is not empty).
Every time I try, I get a runtime error (the line with if(inv>0)[i] so it says). Does anyone know what I'm doing wrong?