📢Export

Public exports

All exports are server-side and live in server/exports.lua. They can be called from any other resource on your server.

AddCoins

Add coins to a player's account.

exports['Var-Coins-Shop']:AddCoins(identifier, 500, {
  actor = "admin",
  reason = "event_reward"
})
Argument
Type
Description

identifier

string

Any accepted identifier (see below)

amount

number

Amount of coins to add

context

table?

Optional metadata logged in coins_shop_balance_log

Returns: new balance (number).

RemoveCoins

exports['Var-Coins-Shop']:RemoveCoins(identifier, 100, { reason = "penalty" })

Same signature as AddCoins. Returns the new balance.

GetCoins

Returns: current balance (number).

GetAccount

Returns the full account row: balance, locale, total spent, loyalty tier, etc.

RefreshPlayer

Force the UI of a connected player to resync. Useful after an external AddCoins call when you want the in-game shop to update immediately.

Argument
Type
Description

playerSourceId

number

The server ID of the connected player

RegisterSubscriptionPlans

Register subscription plans dynamically (useful if you generate them from another data source).

GetSubscriptionState

Read a player's current subscription state.

Accepted identifier formats

identifier arguments accept any of the following formats. They are normalized internally by Accounts.resolveIdentifierInput:

  • Online server ID: 42

  • Cfx.re identifiers: steam:110000xxxx, license:xxx, license2:xxx, fivem:xxx, discord:xxx

  • Any registered alias for an offline player

  • Raw string fallback (treated as the canonical identifier)

The default lookup priority is configurable in shared/config.lua:

Last updated