GivePlayerMoney
From SA-MP Wiki
(Difference between revisions)
Revision as of 16:33, 28 October 2013 Badio12 (Talk | contribs) ← Previous diff |
Revision as of 01:32, 5 February 2014 Connor Mead (Talk | contribs) Next diff → |
||
Line 1: | Line 1: | ||
{{Scripting}} | {{Scripting}} | ||
- | {{Title}} | ||
{{Description|Give (or take) money to/from a player.}} | {{Description|Give (or take) money to/from a player.}} | ||
Line 28: | Line 27: | ||
[[Category:Scripting_Functions]] | [[Category:Scripting_Functions]] | ||
+ | |||
+ | [[fr:GivePlayerMoney]] | ||
[[pt:GivePlayerMoney]] | [[pt:GivePlayerMoney]] |
Revision as of 01:32, 5 February 2014
Description:
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. |
Return Values:
This function does not return any specific values.
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.