Skip to content
On this page

Athena.player.currency

Type Aliases

DefaultCurrency

Ƭ DefaultCurrency: "bank" | "cash"

Defined in

server/player/currency.ts:5

Functions

add

Usage

Athena.player.currency.add<CustomCurrency>(player, type, amount): boolean

Add currency type to the player.

Example

ts
const didAddFullAmount = Athena.player.currency.add(somePlayer, 'cash', 25);

Type parameters

Name
CustomCurrency

Parameters

NameType
playerPlayer
typeCustomCurrency | DefaultCurrency
amountnumber

Returns

boolean

Defined in

server/player/currency.ts:20


override

Usage

Athena.player.currency.override(functionName, callback): any

Used to override any internal currency functions.

Parameters

NameType
functionName"add"
callback<CustomCurrency>(player: Player, type: CustomCurrency | DefaultCurrency, amount: number) => boolean

Returns

any

Defined in

server/player/currency.ts:205

Usage

Athena.player.currency.override(functionName, callback): any

Used to override any internal currency functions.

Parameters

NameType
functionName"set"
callback<CustomCurrency>(player: Player, type: DefaultCurrency | CustomCurrency, amount: number) => boolean

Returns

any

Defined in

server/player/currency.ts:206

Usage

Athena.player.currency.override(functionName, callback): any

Used to override any internal currency functions.

Parameters

NameType
functionName"sub"
callback<CustomCurrency>(player: Player, type: DefaultCurrency | CustomCurrency, amount: number) => boolean

Returns

any

Defined in

server/player/currency.ts:207

Usage

Athena.player.currency.override(functionName, callback): any

Used to override any internal currency functions.

Parameters

NameType
functionName"subAllCurrencies"
callback(player: Player, amount: number) => boolean

Returns

any

Defined in

server/player/currency.ts:208


set

Usage

Athena.player.currency.set<CustomCurrency>(player, type, amount): boolean

Replace the current currency type value with this exact value.

Example

ts
const didSetFullAmount = Athena.player.currency.set(somePlayer, 'bank', 25);

Type parameters

Name
CustomCurrency

Parameters

NameTypeDescription
playerPlayer-
typeDefaultCurrency | CustomCurrencyType of currency we are modifying.
amountnumberThe amount we want to set that type to.

Returns

boolean

Defined in

server/player/currency.ts:120


sub

Usage

Athena.player.currency.sub<CustomCurrency>(player, type, amount): boolean

Remove currency type from the player.

Example

ts
const didSubFullAmount = Athena.player.currency.sub(somePlayer, 'cash', 25);

Type parameters

Name
CustomCurrency

Parameters

NameType
playerPlayer
typeDefaultCurrency | CustomCurrency
amountnumber

Returns

boolean

Defined in

server/player/currency.ts:71


subAllCurrencies

Usage

Athena.player.currency.subAllCurrencies(player, amount): boolean

Only subtracts 'bank' and 'cash' currency types. Always takes from cash first.

Example

ts
const didRemoveFullAmount = Athena.player.currency.subAllCurrencies(somePlayer, 25);

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
amountnumber

Returns

boolean

Defined in

server/player/currency.ts:156

Created by Stuyk | Est. 2020