16.08.2013, 13:18
(
Последний раз редактировалось Davide_Simpson; 16.08.2013 в 22:19.
)
Quote:
|
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.
|
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;
}


