esx_addonaccount
Special Accounts System, used by esx_society and esx_billing for storing money.
Usage
There is two types of accounts: shared and not shared.
- Shared accounts doesn’t belong to a specific user. Example:
societyaccounts. - None-shared accounts are created for every user in the server. They are created in db when player is loaded, Example:
esx_propertyaccounts.
Database Information
An addon account must be configured in the database before using it. you must run a server restart after this.
Table Structure
name- type:
string - description: name of the account
- type:
label- type:
string - description: label of the account (not used)
- type:
shared- type:
boolean - description: is the account shared with others? (boolean either
0or1)
- type:
API
getAccount
-
Event:
esx_addonaccount:getAccount- Usage:
TriggerEvent('esx_addonaccount:getAccount', name, owner, cb) - Example:
TriggerEvent('esx_addonaccount:getSharedAccount', 'society_realestateagent', function(account) account.addMoney(500) end) - Usage:
-
Export:
exports['esx_addonaccount']:getAccount- Usage:
exports['esx_addonaccount']:getAccount(name, owner) - Example:
local account = exports['esx_addonaccount']:getAccount('property_black_money', 'steam:0123456789') account.addMoney(500)) - Usage:
getSharedAccount
-
Event:
esx_addonaccount:getSharedAccount- Usage:
TriggerEvent('esx_addonaccount:getSharedAccount', name, cb) - Example:
TriggerEvent('esx_addonaccount:getSharedAccount', 'society_realestateagent', function(account) account.addMoney(500) end) - Usage:
-
Export:
exports['esx_addonaccount']:getSharedAccount- Usage:
exports['esx_addonaccount']:getSharedAccount(name) - Example:
local account = exports['esx_addonaccount']:getSharedAccount('society_realestateagent') account.addMoney(500) - Usage: