DocsGarage

Installation

Requirements, database setup and first start.

Not released yet. These pages are written from the code of manniche_garage and can change before the release.

Requirements

The fxmanifest.lua lists two dependencies. Both must be started before the resource.

  • ox_lib
  • oxmysql

You also need one supported framework: ESX Legacy (es_extended), QB-Core (qb-core) or Qbox (qbx_core).

Optional scripts

  • ox_target or qb-target for Config.Interaction = 'target'
  • A fuel script, a vehicle keys script, a notification script and a text UI script. See Integrations.
  • esx_addonaccount to pay a society account on ESX

Install

  1. Put the manniche_garage folder in your resources folder.
  2. Add the resource to server.cfg after your framework, ox_lib and oxmysql.
  3. Edit config/config.lua (shared) and config/server.lua (server only).
  4. Give your admins the right in ServerConfig.AdminPrincipals. See Commands and permissions.
  5. Start the server and check the console. See First run.
ensure ox_lib
ensure oxmysql
ensure es_extended
ensure manniche_garage

Replace es_extended with qb-core or qbx_core on those frameworks.

The NUI files are plain HTML, CSS and JavaScript in web/ (ui_page 'web/index.html'). There is no web/dist folder and no build step.

Database

With Config.AutoCreateTables = true (the default), the resource runs sql/install.sql on start. Every statement is CREATE TABLE IF NOT EXISTS, so running it again only adds what is missing.

To import it yourself, set Config.AutoCreateTables = false and run sql/install.sql.

Tables created

Table
manniche_garage_vehicles
manniche_garage_garages
manniche_garage_favourites
manniche_garage_log
manniche_garage_impounds
manniche_garage_impound_records
manniche_garage_spawner_vehicles
manniche_garage_spawner_active
manniche_garage_seeded
manniche_garage_settings
manniche_garage_history
manniche_garage_shares
manniche_garage_private
manniche_garage_private_members
manniche_garage_borrows
manniche_garage_trailers
manniche_garage_interiors

Import existing vehicles

Optional. Run sql/import_owned_vehicles.sql once, after install.sql. It inserts a state row in manniche_garage_vehicles for every row in owned_vehicles. Vehicles with stored = 1 become stored, all others become out. Without it, the rows are created on first contact.

The import file reads owned_vehicles. The file itself is written for the ESX table name.

Frameworks and detection

Config.Framework = 'auto' picks the first of these that is started (state started or starting):

  1. qbx_core gives Qbox ('qbx')
  2. qb-core gives QB-Core ('qb')
  3. otherwise ESX ('esx')

Set 'esx', 'qb' or 'qbx' to force one.

First run

When start-up is done, the console prints one line:

[manniche_garage] ready: 2 garages (2 new from config), 1 impound lots, 0 vehicles fixed, 0 spawner rows cleared

The numbers depend on your server. The line shows how many garages and lots were loaded, how many garages came from Config.SeedGarages, and how many vehicles the start-up clean-up fixed.

Then walk to a garage access point (the default seed garage legion is at Legion Square) and open it. Admins can run /garageadmin.