From ef55ab9986e6b3ef0fd303a068065012994ef4b5 Mon Sep 17 00:00:00 2001 From: Mirow Date: Fri, 26 Jul 2024 21:07:16 +0200 Subject: [PATCH] refactor(README): added guide how to use exports --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index db8da6a..f5cc2fb 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ An addon account must be configured in the database before using it. Don't forge | name of the account | label of the account (not used) | is the account shared with others? (boolean either `0` or `1`) | ```lua +-- Using events TriggerEvent('esx_addonaccount:getSharedAccount', 'society_realestateagent', function(account) account.addMoney(500) end) @@ -25,6 +26,13 @@ end) TriggerEvent('esx_addonaccount:getAccount', 'property_black_money', 'steam:0123456789', function(account) account.removeMoney(500) end) + +-- Using exports +local account = exports['esx_addonaccount']:getAccount('property_black_money', 'steam:0123456789') +account.addMoney(500) + +local sharedAccount = exports['esx_addonaccount']:getSharedAccount('society_realestateagent') +sharedAccount.addMoney(500) ``` # Legal