Skip to content

Installation

Install Cuxial Banking step by step: dependencies, inventory items, convars and start order.

Cuxial Banking needs no SQL import. It creates and updates its own tables on every start. You only add the inventory items and, if you want logs, one convar.

Check the dependencies ​

These must be installed and working before you add the bank:

  • ox_lib
  • oxmysql
  • cuxial_bridge, with a framework, an inventory and a target it supports
  • OneSync enabled on the server

cuxial_interactions is optional. When it is running, a bank point that has a ped model becomes an attended NPC with its own blip. Without it, the same point works as a plain target zone with a blip.

Remove your previous bank ​

Only one resource should manage bank accounts. Stop and remove any other banking script before starting this one.

Copy the resource ​

Place the cuxial_banking folder inside your resources directory. Keep the folder name as it is.

Add the items ​

The bank uses six inventory items: three card tiers, the cheque, the business chequebook and the printed receipt. The file install/items.lua has them ready for ox_inventory.

  1. Copy the images from install/images/ to ox_inventory/web/images/.
  2. Paste the entries of install/items.lua inside the return { ... } table of ox_inventory/data/items.lua.
ox_inventory/data/items.lua
lua
['card_standard'] = {
    label = 'Standard Card',
    weight = 5,
    stack = false,
    close = true,
},

['card_premium'] = {
    label = 'Premium Card',
    weight = 5,
    stack = false,
    close = true,
},

['card_elite'] = {
    label = 'Gold Card',
    weight = 5,
    stack = false,
    close = true,
},

['bank_cheque'] = {
    label = 'Cheque',
    weight = 1,
    stack = false,
    close = true,
},

['bank_chequebook'] = {
    label = 'Business Chequebook',
    weight = 50,
    stack = false,
    close = true,
},

['printerdocument'] = {
    label = 'Bank Receipt',
    weight = 1,
    stack = false,
    close = true,
},

Keep stack = false on all six: each card, cheque and receipt carries its own data. Do not add consume to the cheque, the chequebook or the receipt: they are not spent anyway, and with consume = 0 ox_inventory never passes them to the script, so using them does nothing.

The chequebook is not handed out by the bank. Give bank_chequebook to the bosses who should issue business cheques, through a shop, a job stash or your admin tools.

Set how cash is handled ​

By default the bank treats cash as an inventory item named money. Before the first start, make it match your server:

Set the name of your cash item.

shared/config.lua
lua
general = {
    -- ...
    cashItem = 'cash',
},

After the first start, this setting lives in the database. Change it from /bankadmin → Config → General. See Configuration.

Set the convars ​

All of them are optional.

server.cfg
cfg
# Language (en and es are included)
setr ox:locale "en"

# Discord webhook for bank logs
set cuxial_banking_webhook "https://discord.com/api/webhooks/..."

# Optional: a different webhook for one log type
set cuxial_banking_webhook_transfer "https://discord.com/api/webhooks/..."

# Debug traces in the console
setr cuxial_banking_debug "0"

The webhook goes in server.cfg, never in the files of the resource. Without it, no logs are sent.

Start the resource ​

Start the bank after its dependencies, your framework, your inventory and your target:

server.cfg
cfg
ensure ox_lib
ensure oxmysql
# your framework, inventory and target here
ensure cuxial_bridge
# optional
ensure cuxial_interactions
ensure cuxial_banking

On the first start the console lists each database step as it is applied, creates a business account for every job of your framework, and creates the bank branches from data/banks.lua.

On frameworks that store characters in a players table, the first start adds five columns to it: pincode, cuxial_credit_score, cuxial_bank_contacts, opening_date and iban. Back up your database before installing.

Check that it works ​

  1. Join the server and go to a bank. The blip is on the map and the target option opens the bank.
  2. Deposit some cash and withdraw it again. The balance and the history update.
  3. Order a card at the bank, then use it at an ATM with its PIN.
  4. Type /bankadmin with a staff account. The panel opens.

Next: learn how each part works in the Features guide, or adjust the bank in Configuration.

© Cuxial