SA-MP Forums Archive
INI Writing problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: INI Writing problem (/showthread.php?tid=506299)



INI Writing problem - Lidor124 - 12.04.2014

When i make an update to my server and write new PlayerInfo entries in the INI file of a specific player so it writes the entry in the end of the INI file.
So how to make it keep the sequence according to my original entries?
Note*: i use Y_INI.

Healthy INI File:


Corrupted INI FIle: (The password entry is the last one)



Re: INI Writing problem - BroZeus - 12.04.2014

show ur saving script


Re: INI Writing problem - bool - 12.04.2014

The
Код:
INI_SetTag("stuff");
Has to have the same tag as the first one you saved with or it will just write under it with another tag.

Edit: Save password when they register so that it never adds it to the end, because it's the first thing to exist. Do you get what I'm saying?


Re: INI Writing problem - Lidor124 - 12.04.2014

Quote:
Originally Posted by BroZeus
Посмотреть сообщение
show ur saving script
Actally i will give the example of all enteries:

Код:
new var[32];
			new INI:File = INI_Open(UserPath(playerid));
			INI_SetTag(File, "Statistics");
			INI_WriteString(File, "IP", PlayerInfo[playerid][pIP]);
			INI_WriteInt(File, "Password", PlayerInfo[playerid][pPass]);
			INI_WriteInt(File, "Level", PlayerInfo[playerid][pLevel]);
.....
INI_Close(File);



Re: INI Writing problem - Lidor124 - 12.04.2014

Quote:
Originally Posted by bool
Посмотреть сообщение
The
Код:
INI_SetTag("stuff");
Has to have the same tag as the first one you saved with or it will just write under it with another tag.

Edit: Save password when they register so that it never adds it to the end, because it's the first thing to exist. Do you get what I'm saying?
Not exactly. can you show an example of little code?


Re: INI Writing problem - bool - 12.04.2014

Well the top part is self explanatory. If you have two different tags it saves it twice under seperate tags.

You're saving password again at some point, and it's writing it to the bottom because password didn't exist.


Re: INI Writing problem - Lidor124 - 12.04.2014

I have only one tag of "Statistics", i need more something to make it save in entry of "Password" to save the sequence?
and yes i did under my save public for player stats that it will write the password - on the dialog login i did:

Код:
PlayerInfo[playerid][pPass] = inputtext;
i stored it and saved it in the public, will it save the sequence?