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: society accounts.
None-shared accounts are created for every user in the server. They are created in db when player is loaded, Example: esx_property accounts.
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
label
type: string
description: label of the account (not used)
shared
type: boolean
description: is the account shared with others? (boolean either 0 or 1)
API
getAccount
Event: esx_addonaccount:getAccount
Usage: TriggerEvent('esx_addonaccount:getAccount', name, owner, cb)
Example:
Export: exports['esx_addonaccount']:GetAccountTriggerEvent('esx_addonaccount:getSharedAccount', 'society_realestateagent', function(account)
account.addMoney(500)
end)
Usage: exports['esx_addonaccount']:GetAccount(name, owner)
Example:
getSharedAccountlocal account = exports['esx_addonaccount']:GetAccount('property_black_money', 'steam:0123456789')
account.addMoney(500))
Event: esx_addonaccount:getSharedAccount
Usage: TriggerEvent('esx_addonaccount:getSharedAccount', name, cb)
Example:
Export: exports['esx_addonaccount']:GetSharedAccountTriggerEvent('esx_addonaccount:getSharedAccount', 'society_realestateagent', function(account)
account.addMoney(500)
end)
Usage: exports['esx_addonaccount']:GetSharedAccount(name)
Example:
local account = exports['esx_addonaccount']:GetSharedAccount('society_realestateagent')
account.addMoney(500)

