GivePlayerMoney
From SA-MP Wiki
GivePlayerMoney
The function GivePlayerMoney allows you to give or subtract a specific amount of money from a player.
(playerid, money)
| playerid | The ID of the player. |
| money | The amount of money. |
This function does not return a specific value.
public OnPlayerDeath(playerid, killerid, reason) { new string[32]; //Award $10,000 to the killer GivePlayerMoney(killerid, 10000); format(string, sizeof(string), "You now have %d.", GetPlayerMoney(killerid)); SendClientMessage(killerid, 0xFFFFFFAA, string); }
Related Functions
The following functions might be useful as well, as they're related to this function in one way or another.
- ResetPlayerMoney: Set the money of a player to $0.
- GetPlayerMoney: Check how much money a player has.
