GivePlayerMoney

From SA-MP Wiki

Jump to: navigation, search

GivePlayerMoney


The function GivePlayerMoney allows you to give or subtract a specific amount of money from a player.


Parameters:
(playerid, money)
playeridThe ID of the player.
moneyThe amount of money.


This function does not return a specific value, it's best to simply ignore it.


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.

Personal tools