- Documentation
- Shared functions
- getPlayerMoney
Function
getPlayerMoney
Returns the player's money. The server holds the balance; the in-game counter only displays it.
Syntax
int getPlayerMoney(player thePlayer)Arguments
thePlayerplayer- The player.
Returns
The amount.
Example
addCommandHandler("kup", function(player)
if getPlayerMoney(player) < 500 then
outputChatBox("Za mało pieniędzy.", player, 255, 0, 0)
return
end
takePlayerMoney(player, 500)
giveWeapon(player, 22, 50)
end)
Notes
Also in client scripts. On the client the argument is optional: without it the function returns your own money. Only the server can change it.