Store Currencies
Currencies
Currencies are the different types of currency that you can use in Pulsar Store. You can have as many currencies as you want, but you need at least one. The default currency is 'Pulsar Credits'.
Removing the default currency is **NOT** recommended, as it is used for a lot of things. \
The addon may not function correctly if you remove the default currency. \
**No support will be given if you remove the default currency.**
Creating a currency
To create a currency, create a new file in `addons/pulsar-store/lua/pulsar-store/config/currencies/` with the name `sh_<mycurrency>.lua`. Creating a currency needs 4 basic functions and 2 strings to work properly.
Example
Currency Functions
PulsarLib.Currencies Methods
PulsarLib.Currencies.Create
Description:
Creates a new currency.
Arguments:
name
Returns:
Currency
PulsarLib.Currencies.Get
Description:
Gets how much of the specified currency the player has.
Arguments:
function(ply, steamId, amount, onSuccess, onError)
Returns:
Currency
PulsarLib.Currencies.Add
Description:
Adds currency to the player.
Arguments:
function(ply, steamId, amount, onSuccess, onError)
Returns:
Currency
PulsarLib.Currencies.CanAfford
Description:
Checks whether the player can afford the specified amount of currency.
Arguments:
function(ply, steamId, amount, onSuccess, onError)
Returns:
Currency
PulsarLib.Currencies.String
Description:
Defines the display string for the currency.
The first argument is the symbol, the second determines whether it appears on the left or right of the amount.
Arguments:
symbolleft/right
Returns:
Currency
PulsarLib.Currencies.Description
Description:
Sets a basic description of the currency.
Arguments:
string
Returns:
Currency
Currency:Done
Description:
Registers the currency.
Arguments:
- None
Returns:
- None