17.12.2016, 01:23
PHP Code:
PlayerMoney(playerid, amount = -1) {
static money[MAX_PLAYERS];
if(amount != -1) {
money[playerid] = amount;
GivePlayerMoney(playerid, amount - GetPlayerMoney(playerid));
}
return money[playerid];
}
// set
PlayerMoney(playerid, 5000);
// get
new amountOfMoneyPlayerHas = PlayerMoney(playerid);