GivePlayerMoney
From SA-MP Wiki
Give (or take) money to/from a player.
(playerid, money)
| playerid | The ID of the player to give money to. |
| money | The amount of money to give the player. Use a minus value to take money. |
| Returns | This function doesn't 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, 0xFFFFFFFF, string); }
Related Functions
The following functions may be useful, as they are 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.
