Problem with "stock SaveRaceRecords()"
#1

Hi
I'm making a racing record system for my racing system in my gm.
Now I do not create the races in a sciptfile, I add the checkpoints in the GM.
That's because the tut didn't explain how to do it via the sciptfile folder...

So now I want to add racing records I found that there's no other way than doing this via the scriptfile folder.
So I came up with this code:

pawn Код:
public OnGameModeExit()
{
//blabla
    SaveRaceRecords();
    return 1;
}
pawn Код:
stock SaveRaceRecords()
{
    for(new x; x<currentraceslot; x++) //current race slot is all the races in the system
    {
        new file[64], RaceName[100];
        format(RaceName, sizeof RaceName, "%s", RaceInfo[x][racename]); //RaceInfo[x][racename] holds the name
        format(file, sizeof file, "Races/%s.ini", RaceName); //A file for every single race name under the folder 'Races'

        if (INI_Open(file))
        {
            INI_WriteInt("Record", RaceInfo[x][record]);
            INI_Save();
            INI_Close();
        }
    }
    return 1;
}
But when I open and close my GM nothing gets written in the requested folder...
And yes I have created a folder called Races in the scriptfiles...

Any help?
Reply


Messages In This Thread
Problem with "stock SaveRaceRecords()" - by knackworst - 09.09.2013, 13:49
Re: Problem with "stock SaveRaceRecords()" - by Weponz - 09.09.2013, 13:57
Re: Problem with "stock SaveRaceRecords()" - by knackworst - 09.09.2013, 14:01
Re: Problem with "stock SaveRaceRecords()" - by knackworst - 09.09.2013, 14:35

Forum Jump:


Users browsing this thread: 1 Guest(s)