Y_ini Not Saving On Disconnect!
#1

hello guys there is a problem that account is not saving on disconnect i have this under onplayerdisconnect:

pawn Код:
new INI:file = INI_Open(Path(playerid));
        INI_SetTag(file,"Player's Data");
        INI_WriteInt(file,"AdminLevel",pInfo[playerid][Adminlevel]);
        INI_WriteInt(file,"VIPLevel",pInfo[playerid][VIPlevel]);
        INI_WriteInt(file,"Money",GetPlayerMoney(playerid));
        INI_WriteInt(file,"Scores",GetPlayerScore(playerid));
        INI_WriteInt(file,"Kills",pInfo[playerid][Kills]);
        INI_WriteInt(file,"Deaths",pInfo[playerid][Deaths]);
        INI_WriteInt(file,"Adisable",pInfo[playerid][Adisable]);
        INI_Close(file);
Reply
#2

Maybe the ' in your filename give out some problem, im not pratic with y_ini but try out
Reply
#3

INI_SetTag(file,"Player's Data"); // make sure you have defined this same at all

and show you path stock dude
Reply
#4

i have defined it

This is stock
pawn Код:
stock Path(playerid)
{
    new str[128],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(str,sizeof(str),UserPath,name);
    return str;
}
Reply
#5

Show us register file, how you register the data in file.
Reply
#6

dis:

pawn Код:
new hashpass[129];
            WP_Hash(hashpass,sizeof(hashpass),inputtext);
            new INI:file = INI_Open(Path(playerid));
            INI_SetTag(file,"Player's Data");
            INI_WriteString(file,"Password",hashpass);
            INI_WriteInt(file,"AdminLevel",0);
            INI_WriteInt(file,"VIPLevel",0);
            INI_WriteInt(file,"Money",0);
            INI_WriteInt(file,"Scores",0);
            INI_WriteInt(file,"Kills",0);
            INI_WriteInt(file,"Deaths",0);
            INI_WriteInt(file,"Adisable",0);
            INI_Close(file);
Reply
#7

Quote:
Originally Posted by ******
Посмотреть сообщение
I'd set the tag as "Players_Data", no spaces or quotes.
now it stop loading account also.... -_- what i do?
Reply
#8

i have this in login dialog:

pawn Код:
INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid);
can you give me example what you actually mean =)
Reply
#9

Are you using a loop to save all player's data while the server is going to exit? Well then, I suggest you not to do so. Server exits fast, and the INI won't execute many player's data (If many are connected) and so there's a chance where your files get bugged. I suggest you to use a timer to update it.
Reply
#10

Thanks i prefer timer :_)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)