Studios
Towinghouse-3.jpg

Installation

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

Requirements#

The server

Framework qbx_core (Qbox). ESX and plain QBCore are not supported.
Resources ox_lib, oxmysql, ox_target
OneSync Required. The manifest depends on /onesync.
Entity lockdown sv_entityLockdown set to inactive (the default) or relaxed. The clamp prop is a networked object created by the officer's client, and strict blocks it.
Game build 3095 or newer (sv_enforceGameBuild 3095) for the default towtruck3. On an older build set Config.towTruckModel to towtruck or flatbed.
Database MySQL or MariaDB through oxmysql. The impounded_vehicles table is created on start. Impounds also write to the Qbox player_vehicles table (state, body, engine and fuel).
Tested with qbx_core 1.24.0, ox_lib 3.40.0, ox_target 1.17.2, oxmysql 2.14.2 and qbx_vehiclekeys 1.0.3

Optional resources

Each one is checked at run time. When it is not running, its feature falls back or is skipped.

glitch-abstraction Framework, notification and progress layer. Without it the resource calls qbx_core and ox_lib directly.
glitch-uiElements The job step list on the left of the screen. Without it the current step shows in an ox_lib text UI.
qbx_vehiclekeys Truck keys and synced door locks. Without it the server only sets the door lock.
ox_inventory Item rewards on each paid call (metalscrap and cloth by default). Without it no items are given.
koja-cardealer Vehicle prices for impound fees. Without it the qbx_core shared vehicle price is used.
sd-phone Phone groups for the crew bonus, and the officer callsign from its MDT profile table.
glitch-admin Impound logs in its Logs tab. Without it you can set a Discord webhook instead.
glitch-treasury Books impound release fees as money leaving the economy.
glitch-garages Handles owner collection of impounded vehicles. While it runs, the depot retrieval option is hidden.

Installation steps#

  1. Copy the glitch-towing folder into your resources folder. The folder name is case-sensitive: other resources call the exports as exports['glitch-towing'], so a renamed folder breaks them.

  2. Database. The impounded_vehicles table is created when the resource starts. If your database user cannot create tables, run sql/install.sql once by hand. Take a database backup first if you install it on a live server, because impounds change rows in player_vehicles.

  3. Items. The default rewards are metalscrap and cloth. Both must exist in your ox_inventory items, or change Config.rewards to items you have. The package has no item definitions or images of its own.

  4. Add the resource to server.cfg, after its dependencies and after any optional resources you use:

    set sv_enforceGameBuild 3095
    # leave sv_entityLockdown unset (inactive) or relaxed: strict blocks clamps
    set sv_entityLockdown relaxed
    
    ensure ox_lib
    ensure oxmysql
    ensure qbx_core
    ensure ox_target
    ensure ox_inventory
    ensure qbx_vehiclekeys
    
    # optional, before the towing job
    ensure glitch-abstraction
    ensure glitch-uiElements
    
    ensure glitch-towing
    
  5. Permissions. There are no ACE permissions or chat commands. Access follows the player's job:

    • Police options need an on-duty job from Config.PoliceJob ('police' by default, or a list such as { 'police', 'sheriff' }).
    • Grade Config.rankCustomPrice (5) and up can type their own impound fee. Grade Config.releaseGrade (7) and up can release vehicles through the ReleaseVehicle export as police.
    • Anyone can start a tow shift unless you set Config.requiredJob to a job name such as 'tow'.
  6. Edit config.lua: set the depot (Config.locations.startJob) and the impound yard drop-off for your map, and the police job names.

  7. Start the server and walk up to the depot ped. The ox_target option is called Start Towing Shift.

Updating#

Read CHANGELOG.md first. Replace everything except the files you changed, usually config.lua, locales/ and the ui/ logo if you swapped it. Compare the new config.lua with yours, merge any new settings, then restart the resource. The table is created with CREATE TABLE IF NOT EXISTS, and release claims left in the releasing status by a crash are handed back to impounded on start.