ox_core: Player tweaks, and docs for accounts

This commit is contained in:
Linden committed 2022-07-27 20:16:30 +10:00
1 parent 7f99ef97e1
commit d21e19e9a3
4 files changed
+133 -28

No files matched your search

+45
View File
@@ -0,0 +1,45 @@
---
title: Methods
---
These functions are inherited by instances of CVehicle.
```lua
local accounts = Ox.GetAccounts(owner)
```
## accounts.get
Gets the current balance for an account.
```lua
local account = 'fleeca'
local balance = accounts.get(account)
```
## accounts.set
Sets the balance of an account to the given amount.
```lua
local account, newBalance = 'fleeca', 200
accounts.set(account, newBalance)
```
## accounts.add
Increases the balance of an account by the given amount.
```lua
local account, amount = 'fleeca', 100
accounts.add(account, amount)
```
## accounts.remove
Decreases the balance of an account by the given amount.
```lua
local account, amount = 'fleeca', 100
accounts.remove(account, amount)
```