Quicker way of doing this?
#1

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.
Reply
#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
#3

'quicker' I refer to, when I guess it's not the correct terminology. I mean more efficient. A way of doing something so it is executed faster.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)