SA-MP Forums Archive
Loading With Y_INI - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Loading With Y_INI (/showthread.php?tid=313948)



Loading With Y_INI - Genuine Life Roleplay - 28.01.2012

This doesn't load:

pawn Код:
enum FactionData
{
    fName[128],
    fType
   
};

new FactionInfo[20][FactionData], Total_Faction_Created;
pawn Код:
public LoadFactions(factionid,name[],value[])
{
        INI_String("fName",FactionInfo[factionid][fName],128);
        INI_Int("fType",FactionInfo[factionid][fType]);
        return 1;
}
stock LoadFaction()
{
    Total_Faction_Created = 1;
    for(new i = 1;i<MAX_FACTIONS;i++)
        {
            new file[64];format(file,sizeof file,FACTION_PATH,i);
            if(fexist(file))
            {
                    new INI:handler = INI_Open(file);
                    INI_ParseFile(file,"LoadFactions",.bExtra = true, .extra = i);
                    printf("%s %d", FactionInfo[i][fName], FactionInfo[i][fType]);
                    INI_Close(handler);
                   
                    Total_Faction_Created++;
                   
            }
        }

    printf("%i faction(s) loaded.",Total_Faction_Created);
}
The printf shows: "blank 0" Blank as in literally nothing there, and the 0 is the "%d" yet it's set as 2 and 1, but shows up at 0, meaning it's not loading.

"LoadFaction();" is under OnGameModeInIt