Summary

Methods

Makes the currency object callable as a shorthand for CLASS_TABLE:Query.
Creates a new currency object with empty data.
Returns the currency's default amount.
Returns the currency's world model.
Returns a value from the currency's data.
Sets a value in the currency's data.
Sets the currency's default amount.
Sets the currency's world model.

Methods

CLASS_TABLE:__call(parameter, failSafe)

shared gamemodes/catwork/gamemode/core/libraries/sh_currency.lua:25

Makes the currency object callable as a shorthand for CLASS_TABLE:Query.

local model = currency('model', 'models/props_c17/briefcase001a.mdl')

Parameters

  • parameter String Data key to read
  • failSafe Any optional, defaults to nil Value returned when the key is not set

Returns

  • Any The stored value, or failSafe

Creates a new currency object with empty data.

Use cw.currency:Add to create and store a currency.

Parameters

  • name String Display name of the currency

Returns

  • Map The new currency object

Returns the currency's default amount.

Returns

  • Number The default amount, 0 when none is set

Returns the currency's world model.

Returns

  • String The model path; a briefcase model when none is set

CLASS_TABLE:Query(key, failSafe)

shared gamemodes/catwork/gamemode/core/libraries/sh_currency.lua:47

Returns a value from the currency's data.

Parameters

  • key String Data key to read
  • failSafe Any optional, defaults to nil Value returned when the key is not set

Returns

  • Any The stored value, or failSafe

CLASS_TABLE:SetData(key, value)

shared gamemodes/catwork/gamemode/core/libraries/sh_currency.lua:59

Sets a value in the currency's data.

Parameters

  • key String Data key to set
  • value Any New value

CLASS_TABLE:SetDefault(amount)

shared gamemodes/catwork/gamemode/core/libraries/sh_currency.lua:89

Sets the currency's default amount.

Parameters

  • amount Number The default amount

Sets the currency's world model.

Parameters

  • model String Model path

Defined in