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