Issue with foreach.
#1

I'm working on a dynamic door script, and I want to use foreach for looping.

I add this as a global var.
pawn Код:
new Iterator:Door<MAX_DOORS>;
Later on in my code I have.
pawn Код:
foreach(Door, i)
{
    format(string, sizeof(string), DOOR_PATH, i);
    if(fexist(string))
    {
        INI_ParseFile(DoorPath(i), "LoadDoor_%s", .bExtra = true, .extra = i);
        DoorCount++;
    }
    else
    {
        print("------------------------------");
        printf("SERVER: Loaded %d Dynamic Doors",DoorCount);
        print("------------------------------");
        return 1;
    }
}
The compiler is saying that "Door@YSI_Cg" is never used when I'm clearly using the loop. Also, none of the code inside the loop is being called at all. What am I doing wrong? Help would be greatly appreciated.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)