02.05.2014, 12:21
(
Последний раз редактировалось maximthepain; 02.05.2014 в 13:01.
)
Hi. I'm having a problem,
when Y_INI writes to files (Saving) he creates another TAG sometimes on one of the files. Which is looks like this:
Here is the problems:
1.Sometime Y_INI writes to file it creates another same tag, shouldn't it recognize the first tag and rewrite to it?
2.In other files he even erases the loaded data and rewrites empty data. example:
I wrote the above code to the file and expect the Y_INI to load it. and it works well.
Before Saving(writing existed values to files):
Afterwards Y_INI trying to save the loaded stuff, instead it erases the loaded strings.
After Saving:
When Y_INI empty the data in Rank1 he doesn't create another TAG.
When Loading the file, it loads perfectly.
But saving doesn't going too well.
Loading - OnGameModeInit, Saving - OnGameModeExit.
This is the code of the Saving & Loading. Please look at the problem.
when Y_INI writes to files (Saving) he creates another TAG sometimes on one of the files. Which is looks like this:
pawn Код:
[FactionData]
Rank1 = Cadet
[FactionData]
Rank1 = Cadet
1.Sometime Y_INI writes to file it creates another same tag, shouldn't it recognize the first tag and rewrite to it?
2.In other files he even erases the loaded data and rewrites empty data. example:
I wrote the above code to the file and expect the Y_INI to load it. and it works well.
Before Saving(writing existed values to files):
pawn Код:
[FactionData]
Rank1 = Cadet
After Saving:
pawn Код:
[FactionData]
Rank1 =
When Loading the file, it loads perfectly.
But saving doesn't going too well.
Loading - OnGameModeInit, Saving - OnGameModeExit.
This is the code of the Saving & Loading. Please look at the problem.
pawn Код:
#define F1PATH "/Factions/LSPD.ini"
enum facInfo
{
fRank1[32]
}
new FacInfo[MAX_FACTIONS][facInfo];
forward SaveF1();
public SaveF1()
{
new INI:File = INI_Open(F1PATH);
INI_SetTag(File,"FactionData");
INI_WriteString(File, "Rank1", FacInfo[1][fRank1]);
INI_Close(File);
}
forward LoadLSPD_data(playerid,name[],value[]);
public LoadLSPD_data(playerid,name[],value[])
{
INI_String("Rank1",FacInfo[1][fRank1],32);
}
stock SaveFactions()
{
SaveF1();
}
stock LoadFactions()
{
INI_ParseFile("/Factions/LSPD.ini", "LoadLSPD_data");
}