[Include] samp-account
#15

A minor update has been added to allow real-time saving of account data via UpdateAccountData.
pawn Код:
stock UpdateAccountData(playerid, {Float,_}:...)
The function can save a variable number of data up to the Pawn parameter limit; minus 1. So it can be called
pawn Код:
UpdateAccountData(playerid, gPlayerKills);
// or
UpdateAccountData(playerid, gPlayerKills, gPlayerScore);
A more complete example:
pawn Код:
new gPlayerKills[MAX_PLAYERS];
new gPlayerScore[MAX_PLAYERS];

public OnGameModeInit() {
    AddAccountData("kills", TYPE_INT, gPlayerKills);
    AddAccountData("score", TYPE_INT, gPlayerScore);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason) {
    if(IsPlayerLoggedIn(killerid)) {
        gPlayerKills[killerid]++;
        gPlayerScore[killerid] += 500;
        UpdateAccountData(killerid, gPlayerKills, gPlayerScore);
    }
    return 1;
}
Reply


Messages In This Thread
samp-account - by nG Inverse - 04.10.2018, 20:32
Re: samp-account - by Calisthenics - 04.10.2018, 21:27
Re: samp-account - by nG Inverse - 04.10.2018, 23:11
Re: samp-account - by DTV - 04.10.2018, 23:39
Re: samp-account - by Variable™ - 05.10.2018, 00:54
Re: samp-account - by DRIFT_HUNTER - 05.10.2018, 23:35
Re: samp-account - by J0sh... - 05.10.2018, 23:51
Re: samp-account - by Dayrion - 06.10.2018, 19:55
Re: samp-account - by Gammix - 06.10.2018, 20:26
Re: samp-account - by nG Inverse - 07.10.2018, 03:23
Re: samp-account - by Sasino97 - 07.10.2018, 18:43
Re: samp-account - by corne - 24.10.2018, 06:44
Re: samp-account - by nG Inverse - 31.10.2018, 05:57
Re: samp-account - by corne - 31.10.2018, 06:55
Re: samp-account - by nG Inverse - 10.11.2018, 09:08

Forum Jump:


Users browsing this thread: 3 Guest(s)