Skip to content

Commit

Permalink
refactor(README): added guide how to use exports
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirrrrrow committed Jul 26, 2024
1 parent 3f9ce9e commit ef55ab9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,21 @@ 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)

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
Expand Down

0 comments on commit ef55ab9

Please sign in to comment.