SA-MP Forums Archive
Y_Ini wont save Users stats - 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: Y_Ini wont save Users stats (/showthread.php?tid=546119)



Y_Ini wont save Users stats - ohmy - 13.11.2014

why my Gamemode wont save users stats, and not created the .ini files. can you tell me why??


Re: Y_Ini wont save Users stats - Banana_Ghost - 13.11.2014

Post all of your code regarding y_ini. Pastebin it please.


Re: Y_Ini wont save Users stats - ohmy - 13.11.2014

Quote:
Originally Posted by Banana_Ghost
Посмотреть сообщение
Post all of your code regarding y_ini. Pastebin it please.
http://pastebin.com/aphw9HXF


Re: Y_Ini wont save Users stats - Quickie - 13.11.2014

try this one
pawn Код:
#define PATH "Users/%s.ini"
//or
#define PATH "Users\%s.ini"



Re: Y_Ini wont save Users stats - ohmy - 13.11.2014

I Try that two but not working


Re: Y_Ini wont save Users stats - Riddick94 - 13.11.2014

pawn Код:
public LoadUser_data(playerid, name[], value[])
{
    if(!strcmp(name, "Password"))   strmid(PlayerInfo[playerid][pPass], value, 0, 128);
    if(!strcmp(name, "Cash"))       PlayerInfo[playerid][pCash] = strval(value);
    // Rest of your data to load.
}
DIALOG_LOGIN:
pawn Код:
INI_ParseFile(UserPath(playerid), "LoadUser_Data", .bExtra = true, .extra = playerid);
First of all, you had password loading set as INT, where password is a STRING, not an integer. I think that should load your data back in game.

edit://
You mentioned it doesn't save. Does it actually load? I will check your saving procedure.

When user registers, you have to change that:
pawn Код:
INI_WriteInt(File,"Password",udb_hash(inputtext));
To that:
pawn Код:
INI_WriteString(File, "Password", udb_hash(inputtext));
Also, the file you are creating is getting the name of the user's ID. Which means it can be overwritten. Instead of that, use the user name to create the file in your directory.


Re: Y_Ini wont save Users stats - ohmy - 13.11.2014

Can you pastebin the all of the script?

EDIT: i mean if you register, and you relog it will back to register again, and the INI not create the users


Re: Y_Ini wont save Users stats - ohmy - 15.11.2014

im still need help