From c2a1c9bbfdf7b9b31648c56d9f66a926ca543b44 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Mon, 10 Oct 2022 12:56:51 +1100 Subject: [PATCH] ox_core: remove Accounts, add pefcl to setup --- docs/ox_core/Accounts/Server/index.md | 17 ---------- docs/ox_core/Accounts/Server/methods.md | 45 ------------------------- docs/ox_core/Getting Started/index.md | 20 ++++++++--- docs/ox_core/Player/Server/methods.md | 21 ------------ 4 files changed, 16 insertions(+), 87 deletions(-) delete mode 100644 docs/ox_core/Accounts/Server/index.md delete mode 100644 docs/ox_core/Accounts/Server/methods.md diff --git a/docs/ox_core/Accounts/Server/index.md b/docs/ox_core/Accounts/Server/index.md deleted file mode 100644 index df74761c..00000000 --- a/docs/ox_core/Accounts/Server/index.md +++ /dev/null @@ -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. diff --git a/docs/ox_core/Accounts/Server/methods.md b/docs/ox_core/Accounts/Server/methods.md deleted file mode 100644 index 47e66778..00000000 --- a/docs/ox_core/Accounts/Server/methods.md +++ /dev/null @@ -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) -``` diff --git a/docs/ox_core/Getting Started/index.md b/docs/ox_core/Getting Started/index.md index ddca473d..fcd60eaa 100644 --- a/docs/ox_core/Getting Started/index.md +++ b/docs/ox_core/Getting Started/index.md @@ -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 + +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 +}, +``` diff --git a/docs/ox_core/Player/Server/methods.md b/docs/ox_core/Player/Server/methods.md index c6f4f03d..0716d229 100644 --- a/docs/ox_core/Player/Server/methods.md +++ b/docs/ox_core/Player/Server/methods.md @@ -76,27 +76,6 @@ const iq = player.get('iq'); -## player.getAccounts - -Returns an instance of CAccount for the player. - - - - -```lua -player.getAccounts() -``` - - - - -```ts -player.getAccounts(); -``` - - - - ## player.getCoords Return the player's world position.