Reading files
#4

Have something like this:
pawn Код:
stock LoadHouses() // Under OnGameModeInit
{
    for(new i = 1; i < MAX_HOUSES; ++i) // MAX_HOUSES define. Change if needed.
    {
        new
            House_File[15];

        format(House_File, sizeof(House_File), "%d.ini", i); // This will read the files starting from 1

        if(fexist(House_File)) // If the file exists
        {
            // Use dini to load the info and store it into your global variables.
        }
    }
    return 1;
}
I don't know much about your code, but you'll get the idea behind it.
Reply


Messages In This Thread
Reading files - by yanir3 - 30.05.2011, 05:43
Re: Reading files - by Steven82 - 30.05.2011, 06:14
Re: Reading files - by Backwardsman97 - 30.05.2011, 06:25
Re: Reading files - by [L3th4l] - 30.05.2011, 06:30
Re: Reading files - by yanir3 - 30.05.2011, 06:33
Re: Reading files - by yanir3 - 30.05.2011, 07:31
Re: Reading files - by yanir3 - 30.05.2011, 08:50
Re: Reading files - by yanir3 - 30.05.2011, 10:52
Re: Reading files - by yanir3 - 30.05.2011, 16:31
Re: Reading files - by yanir3 - 31.05.2011, 06:34

Forum Jump:


Users browsing this thread: 1 Guest(s)