Garages

Garages is a single resource to solve garage requirements for roleplay servers.

Info

This resource aims to satisfy most of the personal vehicle garage requirements for your server.

  • Multiple UI and interaction methods (NUI showroom, basic context menu, persistent parking zones).

  • Highly configurable access control (job, group/gang, character identifier restrictors).

  • Class restrictions.

  • Capacity restrictions.

Setup

Config

All of the config vars found below are stored within the config.lua file.

config = {
    -- This is only used for online mechanic duty count.
    mechanicJobs = {
        "mechanic", 
    },

    -- How many mechanics must be online before the "fix vehicle" option in NUI garages is no longer available?
    mechanicsToRepair = 3, 
    
    -- Price to repair a vehicle from NUI showroom if no mechanics online.
    repairPrice = 500,
    
    -- Price to retrieve vehicle from impound.
    impoundFine = 750,
    
    -- Price to deliver vehicle from another garage to the current garage.
    deliveryPrice = 1000,

   -- Should vehicles that are lost in the world be restored to impound on restart?
    restoreLostVehicles = true, 
}

Garage Creation

All garage configuration can be found in the garages.lua file.

For garage-type specific config options, and for more information on creating new garages, read the documentation

Labels

All labels and translations can be found within the labels.lua file.

labels = {
    db_vehicle_not_found = "Error attempting to find vehicle in database.",
    db_props_model_err = "The vehicle model does not match the database model.",
    ...
}

Usage

  • Some basic options are found within the config.lua file (as listed above).

  • All translations are handled in the labels.lua file.

  • For a working example on how to create a garage of any given type (showroom, menu, persistent), check out the garages.lua file. All new garage definitions should be added here.

  • Class restrictions use the same indexes found here: https://docs.fivem.net/natives/?_0x29439776AAA00A62, or you can use -1 to allow all classes at a garage.

SQL

This resource uses the default QB-Core and ESX database scheme for tables:

  • QB: player_vehicles

  • ESX: owned_vehicles

If you're using ESX, execute this SQL query:

ALTER TABLE `owned_vehicles` ADD COLUMN `garage` varchar(60) NOT NULL DEFAULT "";

Conflicting Resources

  • None known currently, though we would recommend avoiding anything that also modifies the above database tables.

Dependencies

    qb-core AND qb-menu
es_extended AND esx_context

Video

Last updated