Give money to an Offline Player.
#4

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.
Reply


Messages In This Thread
Give money to an Offline Player. - by Davide_Simpson - 16.08.2013, 11:36
Re: Give money to an Offline Player. - by gtakillerIV - 16.08.2013, 12:04
Re: Give money to an Offline Player. - by Davide_Simpson - 16.08.2013, 13:00
Re: Give money to an Offline Player. - by Davide_Simpson - 16.08.2013, 13:18
Re: Give money to an Offline Player. - by Vanter - 17.08.2013, 13:04
Re: Give money to an Offline Player. - by Davide_Simpson - 17.08.2013, 13:28

Forum Jump:


Users browsing this thread: 1 Guest(s)