y_Ini doesn't load me variables - 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 doesn't load me variables (
/showthread.php?tid=473311)
y_Ini doesn't load me variables -
ReshiramZekrom - 02.11.2013
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;
}
Re: y_Ini doesn't load me variables -
dusk - 02.11.2013
You set the tag
pawn Code:
INI_SetTag(File,"Progressi");
And the loading function is "loadaccount_user"...
Try
Re: y_Ini doesn't load me variables -
ReshiramZekrom - 02.11.2013
It works! Very thanks! I didn't understand well the function