players.setMoney
Sets the money on a player’s HUD. It’s GTA:SA’s own HUD money, what the player sees: keep the real balance in your gamemode’s own data and set the HUD from it.
Signature
Section titled “Signature”players.setMoney(player: PlayerTarget, amount: number): Promise<ActionResult>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
player |
PlayerTarget |
The player, or their ID. |
amount |
number |
The amount to show, -999,999,999 to 999,999,999. |
Returns
Section titled “Returns”A promise of an ActionResult: applied once the player’s game has carried it out, rejected with a code, or timeout after five seconds without an answer.
Example
Section titled “Example”import { players, server } from "nativemp";
server.on("playerSpawned", async ({ player }) => { await players.setMoney(player, account.balance); // from your own data});Related
Section titled “Related”players.giveMoney: the other way to change itpickups.create: type 8 pickups are money
A captured Player keeps this effect bound to its connection across awaits; see Async handlers.