Load Houses not working.
#1

Hello.
I'm making House System.
I looked alot of tutorials, i couldn't find any y_ini, so i did it myself.
And loading houses don't work, i don't understand.
I ******d to find help. But i didn't find.

CODE:
pawn Код:
forward LoadHouses_data(i, name[], value[]);

stock AddHouses(){
    for(new i = 0; i < MAX_HOUSES; i++)
    {
        INI_ParseFile(Houses(i), "LoadHouses_%s", .bExtra = true, .extra = i);
    }
    return 1;
}

public LoadHouses_data(i, name[], value[]){
    new INI:File = INI_Open(Houses(i));
    new HouseOwner[25];
    new labelstring[100];
    format(hInfo[i][Owner], 24, "%s", HouseOwner);
    INI_String("Owner",HouseOwner, 24);
    INI_Int("Price", hInfo[i][Price]);
    INI_Int("Owned", hInfo[i][Owned]);
    INI_Float("XPos", hInfo[i][XPos]);
    INI_Float("YPos", hInfo[i][YPos]);
    INI_Float("ZPos", hInfo[i][ZPos]);
    INI_Int("VW", hInfo[i][VW]);

    EnterHouse[i] = CreateDynamicCP(hInfo[i][XPos], hInfo[i][YPos], hInfo[i][ZPos], 1.5, hInfo[i][VW]);
    ExitHouse[i] = CreateDynamicCP(443.9237,509.4609,1001.4195, 1.5, hInfo[i][VW]);

    switch(hInfo[i][Owned]){
        case 0:{
            format(labelstring, sizeof(labelstring), "[House]\nOwner: None\nPrice: %i\n", hInfo[i][Price]);
        }
        case 1:{
            format(labelstring, sizeof(labelstring), "[House]\nOwner: %s", hInfo[i][Owner]);
        }
    }
    hInfo[i][HouseLabel] = Create3DTextLabel(labelstring, ORANGE, hInfo[i][XPos], hInfo[i][YPos], hInfo[i][ZPos], 25.0, hInfo[i][VW]);
    HouseCount ++;
    printf("House ID %d created.",i);
    INI_Close(File);
    return 1;
}
I have 5 houses in houses folder and console tell me "House ID 0 Created." and "House ID 1 created". And don't load others.

So i go in-game, and there's no label or checkpoint.
Reply
#2

Need help! Please.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)