DocsGarage

Configuration

Every option in config.lua and server.lua, plus language and hooks.

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

Config files

FileSideWhat it holds
config/config.luasharedConfig: language, interaction, integrations, distances
config/server.luaserver onlyServerConfig: fees, limits, rate limits, admin rights
config/garages.luasharedConfig.SeedGarages and Config.SeedImpounds
config/hooks.luaserverServerHooks functions
config/ipls.luasharedIPLS: base-game garage interiors for the interior editor
config/props_allow.luaserverVehicle property fields the server accepts from a client
Some settings can also be changed in the /garageadmin menu without a restart. The values an admin saves are stored in manniche_garage_settings and are laid over the config files at start-up. Rate limits cannot be changed there.

Language

Set Config.Locale in config/config.lua. The value is a key from Locales. If a text is missing in that language, the English text is used.

Config.Locale = 'en'

Locale files in locales/: ar, cn, cs, da, de, en, es, fi, fr, hu, it, ja, lt, nl, pt, ro, sv, vi, zh-tw. To add a language, add a file that sets Locales['xx'] and set Config.Locale to 'xx'.

Config (config.lua)

General

OptionDefaultWhat it does
Config.Locale'en'Language for all text
Config.Framework'auto''auto', 'esx', 'qb' or 'qbx'
Config.AutoCreateTablestrueRun sql/install.sql on start
Config.DebugfalsePrint extra lines in the server console while setting up
Config.ImpoundCommand'iv'Command a job with impound rights uses to impound the nearest vehicle
Config.AdminCommand'garageadmin'Command that opens the admin menu
Config.PrivateDashboardJobs{}Jobs that may use /privategarages. An empty list lets everyone use it

Interaction

OptionDefaultWhat it does
Config.Interaction'textui''textui', 'target', '3dtextui' or 'radial'. A table sets it per kind with a fallback: { default = 'textui', garage = 'target', impound = 'textui' }. Unknown values give 'textui'
Config.Target'auto'Target script for 'target': 'auto' (ox_target, then qb-target), 'ox_target' or 'qb-target'
Config.OpenStoreKey38Control used to park at the access point when a garage has "store with the key" on. The same key opens the menu on foot (38 is E)
Config.UseDistance3.0Metres from a garage point within which the menu opens (added to its radius)
Config.StoreDistance8.0Metres from a garage point within which a vehicle may be parked (added to its radius)

Integrations

OptionDefaultValues
Config.Notifications'ox_lib''ox_lib', 'esx', 'okokNotify', 'ps-ui', 'custom'. 'custom' fires the client event manniche_garage:notifyCustom with (text, kind, title)
Config.TextUI'ox_lib''ox_lib', 'jg-textui', 'okokTextUI', 'ps-ui', 'esx', 'custom'. 'custom' fires manniche_garage:textUiShow with (text) and manniche_garage:textUiHide
Config.FuelSystem'auto''auto' (first started one), a name from bridge/fuel.lua, or 'native'. Unknown names use native. Listed: ox_fuel, LegacyFuel, ps-fuel, lj-fuel, cdn-fuel, hyon_gas_station, okokGasStation
Config.VehicleKeys'auto''auto', a name from bridge/keys.lua, or 'custom'. Listed: qbx_vehiclekeys, qb-vehiclekeys, jaksam-vehicles-keys, mk_vehiclekeys, qs-vehiclekeys, wasabi_carlock, cd_garage, okokGarage, t1ger_keys. The events fire in every mode, see Events

Vehicles

OptionDefaultWhat it does
Config.TypeMapcar = { 'car' }, air = { 'aircraft', 'heli', 'plane' }, sea = { 'boat' }Which owned_vehicles.type values each garage type shows
Config.VehicleTypes{}QB-Core and Qbox only. Model to type for add-on vehicles, for example { myaddonheli = 'heli' }. Types otherwise come from the shared vehicle list
Config.FakePlates'auto'Brazzers-FakePlate. 'auto' looks once at start for a fakeplate column; false ignores it
Config.VehicleLabels{}Names for add-on vehicles by spawn name, for example { myaddoncar = 'My Add-on Car' }
Config.MaxDeformation24Dents kept per vehicle when it is parked
Config.DeformationStrength600How hard dents are pushed back in. Raise it if restored dents look too faint
Config.TakeFromAnyGaragefalsetrue: a stored vehicle can be taken out of any garage of its type. false: only where it was parked
Config.WarpIntoVehicletruePut the player in the driver seat when a vehicle comes out

Vehicle pictures

OptionDefaultWhat it does
Config.VehicleImages'https://docs.fivem.net/vehicles/%s.webp'Picture URL. %s becomes the spawn name. false shows drawings only
Config.VehicleImageFiles{}Pictures for add-on vehicles by spawn name. A vehicle without a picture shows a drawing of its type

Server config (server.lua)

Clients never download config/server.lua.

General and admin

OptionDefaultWhat it does
ServerConfig.Webhook''Discord webhook for the garage log. Empty logs to the database only
ServerConfig.AdminPrincipals{ 'group.admin' }, or { 'qbcore.admin', 'qbcore.god' } on QB-CoreACE principals that may use the admin commands
ServerConfig.ExportResources{}Allowlist of resources that may call the server exports. Empty lets every resource call
ServerConfig.AdminMaxSpawnDistance150.0Metres a spawn point may lie from its access point
ServerConfig.KickAfterRejects50Kick a player after this many calls turned down by a rate limit without a quiet minute in between. 0 turns it off
ServerConfig.KeepLooksFromDatabasetrueWhen parking, take only condition (damage, fuel, dirt) from the client and keep mods, colours and neon from the database

Rate limits

ServerConfig.RateLimits sets, per player and action, how many calls refill (rate) per per seconds, up to burst at once.

Actionrateperburst
default113
takeOut122
store122
openMenu214
impound132
admin5110
trade114
track152
interior123
interiorExit114
mileage1202
private114

Impound and lost vehicles

OptionDefaultWhat it does
ServerConfig.RecoverFee500Cost to get back a vehicle destroyed or despawned while out. 0 is free
ServerConfig.LostVehicles'impound'After a restart, for vehicles that were out and are gone: 'impound' sends them to the impound (ImpoundFee), 'store' puts them in their garage, 'recover' leaves them out so the player pays RecoverFee
ServerConfig.ImpoundOnLogouttrueVehicles still out when the owner logs off are removed and impounded
ServerConfig.ImpoundFee5000Cost to get a vehicle out of the impound when no job set a fee
ServerConfig.ImpoundMinFee0Lowest fee an officer may enter at /iv
ServerConfig.ImpoundMaxFee50000Highest fee at /iv
ServerConfig.ImpoundMaxHours72Longest waiting time at /iv
ServerConfig.ImpoundDistance6.0Metres the officer may stand from the vehicle at /iv
ServerConfig.AutoImpoundfalseRemove vehicles that have been out for AutoImpoundMinutes with no player within AutoImpoundDistance and nobody in a seat
ServerConfig.AutoImpoundMinutes30Minutes out before auto-impound
ServerConfig.AutoImpoundDistance100.0Metres within which a player stops auto-impound
ServerConfig.AutoImpoundLotfalseId of the impound lot it goes to, or false to only mark it lost (recovered for RecoverFee)
ServerConfig.SaveDamagetrueRestore engine, body and tank health on take-out. false gives a repaired vehicle
ServerConfig.SaveDeformationtrueRestore saved dents on take-out

Society accounts

OptionDefaultWhat it does
ServerConfig.SocietyPayoutnilfunction(account, amount, plate, kind), called once when a vehicle impounded by a job is paid out. kind is 'impound' (or 'transfer'). On QB-Core and Qbox this hook is the only way to pay a society
ServerConfig.SocietyAccounts'auto''auto' uses esx_addonaccount (account society_<job> or the lot's society field) when it runs. false pays nobody. A function in SocietyPayout wins
ServerConfig.TransferFeeSocietynilSociety account that receives transfer fees. nil pays nobody

Transfers, sharing, selling, tracking

OptionDefaultWhat it does
ServerConfig.TransferFee250Cost of moving a vehicle between garages, paid after the move. 0 is free
ServerConfig.EnableTransfers{ betweenGarages = true, betweenPlayers = true }Which transfers are on
ServerConfig.TransferHidePlayerNamesfalseThe nearby player list shows only a server id
ServerConfig.TransferBlacklist{}Spawn names that cannot be transferred or sold to a player
ServerConfig.TransferDistance10.0Metres between two players for a transfer, share or sale
ServerConfig.EnableVehicleSharingtrueShare a vehicle with other players (they can take it out and park it)
ServerConfig.VehicleSharingMaxPlayers3Most players per shared vehicle
ServerConfig.EnableSelltrueSell a vehicle to a nearby player
ServerConfig.SellMaxPrice5000000Highest price (whole money from 1)
ServerConfig.SellOfferSeconds60How long an offer stands
ServerConfig.EnableTracktruePut a map marker where a vehicle that is out is now (not followed live)

Mileage

OptionDefaultWhat it does
ServerConfig.MileageMaxSpeedKmh500The client reports about every 30 seconds. The server accepts no more than this speed allows
ServerConfig.MileageUnit'kilometers''kilometers' or 'miles'. The value is always stored in km

Private garages

OptionDefaultWhat it does
ServerConfig.PrivateMaxMembers8Most members per private garage
ServerConfig.PrivateInteriorTourfalseShow an "Interior tour" button on the sale advert. It fires the client event manniche_garage:interiorTour

Trailers

OptionDefaultWhat it does
ServerConfig.MaxTrailers12Most vehicles on a tow at once, trailers and cargo together
ServerConfig.TrailerDriverMayStaytrueThe driver may stay in the tow while it is parked with trailers
ServerConfig.TrailerLinkDistance16.0Metres a trailer on a hitch must be from the vehicle in front
ServerConfig.TrailerStoreWorldfalseAllow parking a trailer nobody owns that this resource did not spawn
ServerConfig.TrailerSpacing9.0Metres between vehicles in a line when a tow comes out

Interiors

OptionDefaultWhat it does
ServerConfig.InteriorBucketBase1000First routing bucket used for visits (each visit takes its own)
ServerConfig.InteriorInviteMs30000How long an invitation stands, in ms
ServerConfig.InteriorGuestDistance5.0How close a guest must be to the entrance, in metres
ServerConfig.InteriorTourMs60000How long a tour lasts, in ms

Garages and impound lots

Config.SeedGarages and Config.SeedImpounds in config/garages.lua are copied into the database once per entry. After that the database is the source and admins change garages in game. A name that already exists is skipped.

Garage fields

FieldWhat it does
name, labelUnique name and shown name
vehicleTypeThe garage type. The examples use 'car'; Config.TypeMap defines car, air and sea
kind'public' or 'job'
jobWith kind = 'job': the job that may use it
access{ coords = vec3(...), radius = 2.0 }
spawnsList of vec4(x, y, z, heading)
blip{ sprite, colour, scale }
spawnerJob garages: spawner vehicles with model, label, liveries (first is default), extras (extra id = on or off), colours ({ primary = n, secondary = n }), platePrefix, minGrade or grades, limitScope ('garage' or 'player'), limitCount (0 is no limit), allowSetup (the player may change livery and extras first)

Impound lot fields

FieldWhat it does
name, label, access, spawns, blipSame as for a garage
jobsJob to lowest grade that may impound here, for example { police = 0 }
societyAccount that ServerConfig.SocietyPayout gets
feeDefault fee an officer sees at /iv

Hooks (hooks.lua)

Functions in config/hooks.lua run on the server after a vehicle changes hands. They run in their own thread inside pcall, so an error is printed and never stops a take-out or a store. src is the player server id, or 0 when the server did it (for example auto-impound).

Functiondata
ServerHooks.OnTakeOut(src, data)plate, garageId, netId
ServerHooks.OnStore(src, data)plate, garageId
ServerHooks.OnImpound(src, data)plate, impoundId, recordId, auto (impoundId is nil when the vehicle was only marked lost)
ServerHooks.OnTransfer(src, data)plate, kind, from, to, fee, price