Quote:
Originally Posted by ******
y_ini has no concept of "online" or "offline", only "files". All you need is a filename for it to do its job. How you get that is nothing to do with y_ini.
|
I Know that. so i do and now i have:
pawn Код:
if(dialogid == BANKT2 && response)
{
new file[40];
format(file,sizeof(file), "Players/%s.ini",inputtext);
if(!fexist(file)) return SendClientMessage(playerid, -1, ""RED"[ERRORE:]"WHITE" Conto inesistente.");
if(PInfo[playerid][pBalance] < GetPVarInt(playerid, "ImportofTrans"))
INI_ParseFile(file, "LoadBank", .bExtra = true, .extra = playerid);
printf("%d, Before",PInfo[playerid][pLoadedAccount]);
PInfo[playerid][pLoadedAccount] += GetPVarInt(playerid, "ImportofTrans");
printf("%d Import",GetPVarInt(playerid, "ImportOfTrans"));
printf("%d, After",PInfo[playerid][pLoadedAccount]);
new INI:ini = INI_Open(file);
INI_SetTag(ini, "Player's Data");
INI_WriteInt(ini,"BankBalance",PInfo[playerid][pLoadedAccount]);
INI_Close(ini);
PInfo[playerid][pBalance] -= GetPVarInt(playerid, "ImportofTrans");
SavePlayerData(playerid);
return 1;
}
pawn Код:
forward LoadBank(playerid, name[], value[]);
public LoadBank(playerid, name[], value[])
{
// Just a debug message. print("Callback recalled");
INI_Int("BankBalance",PInfo[playerid][pLoadedAccount]);
return 1;
}
And the callback "LoadBank" will not be called by INI_ParseFile, i know is something easy. but i really don't understand why. Sorry for the print's as a debug message for me.