Skip to content

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.

players.setMoney(player: PlayerTarget, amount: number): Promise<ActionResult>
Name Type Description
player PlayerTarget The player, or their ID.
amount number The amount to show, -999,999,999 to 999,999,999.

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.

gamemodes/my-mode.ts
import { players, server } from "nativemp";
server.on("playerSpawned", async ({ player }) => {
await players.setMoney(player, account.balance); // from your own data
});

A captured Player keeps this effect bound to its connection across awaits; see Async handlers.