ox_core: remove Accounts, add pefcl to setup

This commit is contained in:
Linden committed 2022-10-10 12:56:51 +11:00
1 parent 556894055b
commit c2a1c9bbfd
4 files changed
+16 -87

No files matched your search

-17
View File
@@ -1,17 +0,0 @@
---
title: Server
sidebar_position: 1
---
## Ox.GetAccounts
Return an instance of CAccount for the given charid or group.
```lua
local accounts = Ox.GetAccounts(owner)
```
You can use player.getAccounts() to to simplify access to an player accounts, however the standard function works for offline players.
Refer to [vl_banking](https://github.com/Volumed/vl_banking) for a simple implementation of banking using ox_core accounts.
-45
View File
@@ -1,45 +0,0 @@
---
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)
```
+16 -4
View File
@@ -22,11 +22,9 @@ Refer to [GitHub's guide to setting up Git](https://docs.github.com/en/get-start
### Dependencies
- [oxmysql](https://github.com/overextended/oxmysql/)
- Database connector
- Database connector.
- [ox_lib](https://github.com/overextended/ox_lib/)
- Shared functions through modules and exports
- [ox_inventory](https://github.com/overextended/ox_inventory)
- Implements items, weapons, shops, etc.
- Shared functions through modules and exports.
- [fivem-appearance](https://github.com/pedr0fontoura/fivem-appearance)
- Player ped customisation.
- [ox_appearance](https://github.com/overextended/ox_appearance)
@@ -34,7 +32,12 @@ Refer to [GitHub's guide to setting up Git](https://docs.github.com/en/get-start
### Optional dependencies
- [ox_inventory](https://github.com/overextended/ox_inventory)
- Implements items, weapons, shops, etc.
- [pefcl](https://github.com/project-error/pefcl)
- Banking, shared accounts.
- [npwd](https://github.com/project-error/npwd)
- It's a phone.
### Installation
@@ -60,3 +63,12 @@ pnpm build
</TabItem>
</Tabs>
If you're using [pefcl](https://github.com/project-error/pefcl) and [ox_inventory](https://github.com/overextended/ox_inventory), open `config.json` and set frameworkIntegration.
```json
"frameworkIntegration": {
"enabled": true,
"resource": "ox_inventory",
"syncInitialBankBalance": false
},
```
-21
View File
@@ -76,27 +76,6 @@ const iq = player.get('iq');
</TabItem>
</Tabs>
## player.getAccounts
Returns an instance of CAccount for the player.
<Tabs>
<TabItem value='lua' label='Lua'>
```lua
player.getAccounts()
```
</TabItem>
<TabItem value='js/ts' label='JS/TS'>
```ts
player.getAccounts();
```
</TabItem>
</Tabs>
## player.getCoords
Return the player's world position.