Skip to content

players.giveMoney

Adds to the money on a player’s HUD, or takes from it with a negative amount. 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.giveMoney(player: PlayerTarget, amount: number): Promise<ActionResult>
Name Type Description
player PlayerTarget The player, or their ID.
amount number How much to add; negative takes money away. -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.giveMoney(player, 500); // a reward
});

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