Loading with y_ini?
#1

Hello everyone I have been trying to figure out how to use INI_ParseFile however I just don't get how it works like for istance how would I load a business when the business file is called business_1 in the path business/business_1 like all I see are user based loading systems and I haven't seen one tutorial that goes into what INI_ParseFile does, I've checked ******'s thread about it and I didn't grasp what he was talking about. Any help is much appreciated.
Reply
#2

If you know how many businesses you have or the max amount you can have then you can do something like this:

pawn Код:
#define MAX_BIZ 10

enum b_
{
    Float:a,
    b,
};
new Biz[MAX_BIZ][b_];

new string[128];

stock LoadBusinesses()
{
    for(new i; i < MAX_BIZ; i++)
    {
        format(string, sizeof(string), "Businesses/Biz_%d", i);
        if(fexist(string))
        {
            INI_ParseFile(string, "LoadBiz", .bExtra = true, .extra = i);
        }
    }
    return 1;
}

forward LoadBiz(i);
public LoadBiz(i)
{
    //....
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)