ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setPlayerMoney

Function

setPlayerMoney

Sets the player's money. The in-game counter shows the server's balance.

Syntax

bool setPlayerMoney(player thePlayer, int amount)

Arguments

thePlayerplayer
The player.
amountint
The amount.

Differences from MTA:SA

  • These MTA:SA arguments are not here: bool instant = false

In MTA:SA

setPlayerMoney(player thePlayer, int amount, bool instant = false)

Returns

true on success.

Example

addEventHandler("onPlayerLogin", root, function(_, account)
    setPlayerMoney(source, getAccountData(account, "money") or 0)
end)

See also