Quicker way of doing this?
#2

Quote:
Originally Posted by 2KY
Посмотреть сообщение
pawn Код:
forward LoadFaction_faction(factionid, name[], value[]);
public LoadFaction_faction(factionid, name[], value[])
{
    INI_String("Name", facInfo[factionid][facName], 64);
    INI_Int("Type", facInfo[factionid][facType]);
    INI_String("Rank1", facInfo[factionid][facRank1], 32);
    INI_String("Rank2", facInfo[factionid][facRank2], 32);
    INI_String("Rank3", facInfo[factionid][facRank3], 32);
    INI_String("Rank4", facInfo[factionid][facRank4], 32);
    INI_String("Rank5", facInfo[factionid][facRank5], 32);
    return true;
}

for( new f = 0; f < MAX_FACTIONS; f++ ) //Reload factions!
{
    format(facStr, sizeof(facStr), "RPMod/Factions/%d.ini", f);
   
    if(fexist(facStr))
    {
        INI_ParseFile(facStr, "LoadFaction_%s", .bExtra = true, .extra = f);
    }
}
This function (re)loads all of my faction data in my dynamic faction system, it uses Y_INI because it's faster with large amounts of files and this system (at its very minimum) is set to support 100 separate faction files, so it's needed.
What do you mean by quicker way?
Reply


Messages In This Thread
Quicker way of doing this? - by 2KY - 16.02.2012, 01:53
Re: Quicker way of doing this? - by Aldo. - 16.02.2012, 01:57
Re: Quicker way of doing this? - by 2KY - 16.02.2012, 01:59

Forum Jump:


Users browsing this thread: 2 Guest(s)