Studios
Treasuryhouse-3.jpg

Installation

SoonTreasuryQbox
PAGE 02 OF 06  ·  OVERVIEW → INSTALLATION → CONFIGURATIONdocs.glitchstudios.dev
Browse docs

Requirements#

Framework qbx_core (Qbox). ESX and plain QBCore are not supported. Tested with qbx_core 1.24.0.
Resources ox_inventory (tested with 2.48.0), oxmysql (tested with 2.14.2), omes_banking
Patches Two small edits to qbx_core and one export added to ox_inventory. The package ships them as install/qbx_core.md and install/ox_inventory.md.
Database MariaDB or MySQL through oxmysql. The treasury balances live in omes_banking's banking_society_accounts table, which must already exist.
Optional glitch-gov (tax levers, pay levers, routing, bankruptcy rules), koja-cardealer or any resource with a GetPlayerPrice(model) export (rego prices), glitch-rentals (rental exemption), glitch-businesstablet (pays the food order grant)

Every optional resource is detected at run time. The matching feature is skipped when the resource is not running.

[!WARNING] Income tax and the paycheck levers do nothing until the qbx_core patches are applied, and the console shows no error. Back up your database first: the resource changes balances in banking_society_accounts.

Installation steps#

  1. Put the glitch-treasury folder in your resources folder. The folder name is case-sensitive and must stay glitch-treasury.

  2. Apply the qbx_core edits from install/qbx_core.md: a tax hook in AddMoney (server/player.lua) and a qbx_core:server:onPaycheck event after sendPaycheck saves the pending paychecks (config/server.lua). Restart qbx_core.

  3. Add the SetTaxMultiplier export from install/ox_inventory.md to modules/shops/server.lua. Without it the treasury still books the GST share of each sale, but shelf prices do not follow the GST rate and the console prints a warning at start. Restart ox_inventory.

  4. The two tables, glitch_treasury_ledger and glitch_treasury_rego, are created when the resource starts. If your database user cannot create tables, run sql/install.sql once by hand. This resource adds no inventory items and no images.

  5. Add the resource to server.cfg, after the resources it depends on:

    ensure oxmysql
    ensure qbx_core
    ensure ox_inventory
    ensure omes_banking
    ensure glitch-treasury
    
  6. Edit config.lua. The shipped file keeps the account names, caller lists and job resources of the city it was built for. For a different server, copy the blocks you need from config.generic.example.lua over it: neutral accounts, empty caller lists and every integration off.

  7. Start the server and type treasury in the server console to check the balances.

There are no permissions to set. The only command runs in the server console.

Updating#

Back up config.lua and your database, then replace the resource files except config.lua, and merge any new keys from the changelog. Re-check the qbx_core and ox_inventory patches after updating either of those resources, since an update overwrites them. If income tax stops, see Troubleshooting.