y_Ini doesn't load me variables
#1

Hi guys, i'm making a thing with a register system without password but when i load the account, it doesn't give me the variables that i've assigned to it
The user's file is always created and it is modified when i've make a change but it doesn't load..


pawn Code:
CMD:bsave(playerid, params[])
{
if(blogged[playerid] == 1) return SendClientMessage(playerid, COLOR_RED,"*** Sei giа loggato!");
if(!fexist(UserPath(playerid)))
{
  UnlockBlack[playerid][codice] = 0;
  UnlockBlack[playerid][indizi] = 0;
  new INI:File = INI_Open(UserPath(playerid));
  INI_SetTag(File,"Progressi");
  INI_WriteInt(File,"Codice",UnlockBlack[playerid][codice]);
  INI_WriteInt(File,"Indizi",UnlockBlack[playerid][indizi]);
  INI_Close(File);
  SendClientMessage(playerid, COLOR_GREEN, "*** Ora i tuoi progressi verranno salvati!");
  blogged[playerid] = 1;
}
else
{
  INI_ParseFile(UserPath(playerid),"loadaccount_%s", .bExtra = true, .extra = playerid);
  SendClientMessage(playerid, COLOR_GREEN, "*** Progressi caricati!");
  blogged[playerid] = 1;
}
return 1;
}


//forward
forward loadaccount_user(playerid,name[],value[]);
public loadaccount_user(playerid,name[],value[])
{
    INI_Int("Codice",UnlockBlack[playerid][codice]);
    INI_Int("Indizi",UnlockBlack[playerid][indizi]);
    return 1;
}

//Userpath
stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),"/BlackEarth/%s.ini",playername);
    return string;
}
Reply
#2

You set the tag
pawn Code:
INI_SetTag(File,"Progressi");
And the loading function is "loadaccount_user"...

Try
pawn Code:
INI_SetTag(File,"user");
Reply
#3

It works! Very thanks! I didn't understand well the function
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)