PDA

View Full Version : Y_INI Values


SpankMe2
30/08/2011, 06:12 PM
Y_INI isnt replacing the value it just creates a new one...

Admin = 0
Admin = 0
Level = 0
Admin = 0
Level = 1

Thats the top of the user file

[MWR]Blood
30/08/2011, 06:14 PM
Well, show the code.
We can't help you without checking it out.

SpankMe2
30/08/2011, 06:27 PM
saving
new INI:File = INI_Open(UserPath(playerid));
INI_WriteInt(File,"Admin Level",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Level",PlayerInfo[playerid][pLevel]
INI_Close(File);


loading

INI_Int("Password",PlayerInfo[playerid][pPass]);
INI_Int("Admin Level",PlayerInfo[playerid][pAdmin]);
INI_Int("Level",PlayerInfo[playerid][pLevel]);

SantarioLeone
30/08/2011, 06:34 PM
saving
new INI:File = INI_Open(UserPath(playerid));
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Level",PlayerInfo[playerid][pLevel]


loading

INI_Int("Password",PlayerInfo[playerid][pPass]);
INI_Int("Admin Level",PlayerInfo[playerid][pAdmin]);
INI_Int("Admin Level",PlayerInfo[playerid][pLevel]);



You have pLevel, and pAdmin named the same thing in the users file.


INI_Int("Password",PlayerInfo[playerid][pPass]);
INI_Int("Admin Level",PlayerInfo[playerid][pAdmin]);
INI_Int("Player Level",PlayerInfo[playerid][pLevel]);


Try that, i may be wrong, but that is a small error could be the fix.

SpankMe2
30/08/2011, 06:38 PM
It still Spams out the player file thanks for tryin though

SantarioLeone
30/08/2011, 06:41 PM
Mind posting the Error messages?

SpankMe2
30/08/2011, 06:43 PM
There isnt any

if there was it wouldnt be able to save the file at all

SpankMe2
30/08/2011, 06:45 PM
Plus thats where i was fidling with the things earlyer i created this thread when i was in the midle of changing it back

ill edit that post

SantarioLeone
30/08/2011, 06:48 PM
It may be possible its a Y_Ini bug cause my Y_Ini wont save anything when a player registers at the moment, so you maybe its not your script, maybe just the Y_Ini. Depending on how much you scripted, think about switching to another dialogue register system.

Wesley221
30/08/2011, 06:55 PM
You need to set Tags if you want to write something in it.

INI_SetTag("Tagname");

SpankMe2
30/08/2011, 06:56 PM
I have that here

INI_SetTag(File,"user");

?? without that i wouldnt be able to login

Wesley221
30/08/2011, 07:04 PM
Then when you try to save it in the file, do it like this:


INI_SetTag(File, "user");
INI_WriteString(File, "Blabla", Blabla);
INI_WriteInt(File, "Blablabla", 1);

Also, if you want to write something else which has a different tag, dont forget to change the tag.

SpankMe2
30/08/2011, 07:06 PM
Still doesnt work :S

SpankMe2
30/08/2011, 07:13 PM
Solved!