Money
Retrieve the local player's money balance from the client side via a server callback.
GetMoney
Fetches the player's cash and bank balance asynchronously.
KOJA.Client.GetMoney(callback)
| Parameter | Type | Description |
|---|---|---|
callback | function(cash, bank) | Called with the result |
Callback parameters
| Parameter | Type | Description |
|---|---|---|
cash | number | Cash on hand |
bank | number | Bank balance |
Example
KOJA.Client.GetMoney(function(cash, bank)
print('Cash:', cash)
print('Bank:', bank)
end)
Example — show in UI
KOJA.Client.GetMoney(function(cash, bank)
SendNUIMessage({
action = 'updateMoney',
cash = cash,
bank = bank,
})
end)
Related pages
- Callbacks — koja-lib provides a callback system that lets client scripts request data from the server and vice versa.
- Inventory — Client-side inventory functions let you check what items the local player has without a server round-trip.
- DUI — DUI (Dynamic UI) allows you to render a web page as a texture on any in-game surface — screens, billboards, laptops, phones, etc.
- Keybinds — Register persistent key bindings that players can rebind in the GTA V settings menu.
- Notifications — koja-lib provides two notification interfaces: SendNotify (routes through the configured backend) and LibNotify (built-in koja-lib notification).
- Player — Functions for reading the local player's data on the client side.
- Client API — back to the section overview