Skip to content
FIVECRATE

Add Addon Cars to a QBCore, Qbox or ESX Dealership

How to add a car to a QBCore dealership, a Qbox vehicle shop or the ESX vehicleshop: the vehicles.lua entry, the SQL rows and the garage storage checks.

Sports coupe displayed in a modern city dealership, with a salesperson reviewing its details on a tablet
Author: FiveCrate
Published:
Updated:
Read time: 21 min
Applies to
FiveM Legacy and FiveM for GTAV Enhanced; qb-core 1.3.0 with qb-vehicleshop 2.1.0 and qb-garages 2.0.0, qbx_core 1.24.1 (2026-10-30) with qbx_vehicleshop and qbx_garages, ESX Legacy addons marked legacyversion 1.16.3; repositories read on 2026-11-20
Last verified

Direct Answer

To add a car to a QBCore dealership, get the addon car spawning as its own resource first, then register its spawn code with your framework. On QBCore, add one row to qb-core/shared/vehicles.lua with shop = 'pdm'. On Qbox, add an entry with a hash line to qbx_core/shared/vehicles.lua and check that the shop in qbx_vehicleshop/config/shared.lua lists the car’s category. On ESX, insert a row into the vehicles table with a category that exists in vehicle_categories. Restart, then buy the car once: the purchase writes the ownership row that every garage checks before it stores a vehicle.

Where QBCore, Qbox and ESX keep the dealership list

A dealership entry is a model name, a label, a price and a category. The model files belong to the car resource, so install that first with how to add addon cars to a FiveM server. This page starts where that one ends: the car spawns, and now players need to buy it and keep it.

QBCoreQboxESX Legacy
Car listqb-core/shared/vehicles.luaqbx_core/shared/vehicles.luavehicles and vehicle_categories database tables
Dealership resourceqb-vehicleshopqbx_vehicleshopesx_vehicleshop
What puts a car in a shopThe shop value in the car’s rowThe vehicles block of qbx_vehicleshop/config/shared.luaNothing extra: the shop lists every row it loads
Ownership tableplayer_vehiclesplayer_vehiclesowned_vehicles
Garage resourceqb-garagesqbx_garagesesx_garage

QBCore’s docs give the reason for the Lua file: “QBCore uses Lua tables for storing static information instead of relying on a database.” Qbox keeps the idea and changes the layout. ESX reads its list from the database each time the shop resource starts.

The formats on this page are the ones in each project’s repository on November 20, 2026: qb-core 1.3.0, qbx_core 1.24.1 (released October 30, 2026) and the ESX Legacy addons whose manifests read legacyversion '1.16.3'.

Before you edit: confirm the spawn code

  1. Install and start the car resource. Until the car spawns, nothing below can be checked.
  2. Spawn it by name. QBCore, Qbox and ESX each register an admin command named car that takes a model name. The Qbox docs give /car sultan as the example. On Qbox, run /optin first, because its docs say admin commands work “after /optin”.
  3. Write the name down exactly as you typed it. That spawn code is the value every framework below asks for. QBCore’s file says the model value “has to match the spawn code of the vehicle”.

If the command is refused, sort out permissions with how to make yourself admin on QBCore, Qbox and ESX. If it runs but no car appears, work through addon car not spawning before you continue.

Add a car to a QBCore dealership in qb-core/shared/vehicles.lua

QBCore’s documentation now states that QBCore “has withdrawn from other platforms” and that its existing pages “remain here as a reference”. This section is for servers that already run QBCore; QBCore vs Qbox vs ESX covers what that status means for a new server.

The same documentation is blunt about vehicles: “If you want to save a vehicle to the database for ownership, it MUST be defined in the shared vehicles table!” Its qb-vehicleshop page adds: “Add custom cars by adding them to your vehicles.lua in your qb-core Shared table”. The dealership resource has no car list of its own.

  1. Open qb-core/shared/vehicles.lua and find the line local Vehicles = {. Each row between that line and its closing brace is one vehicle.

  2. Add a row for your car. Qbox’s migration guide prints a QBCore row for an add-on car. It is shown here inside the list it belongs to:

    local Vehicles = {
        { model = 'mycar', name = 'My Car', brand = 'Custom', price = 50000, category = 'sports', type = 'automobile', shop = 'pdm' },
    }

    The first and last lines stand for the list that is already in your file. Add only the middle row, and keep the comma at its end.

  3. Set the seven values with the table below.

  4. Restart the server. qb-core loads the file as one of its shared scripts, and qb-vehicleshop and qb-garages each read the vehicle table when they start. A full restart refreshes all three.

  5. Buy the car. Open the menu of a showroom car in the shop and choose Swap Vehicle, then the category you set, then your car. That makes it the selected vehicle, and Buy Vehicle purchases it. Store the car in a garage afterwards.

FieldWhat to enter
modelThe spawn code.
nameThe display name players see.
brandThe make. With Config.FilterByMake turned on in qb-vehicleshop, the shop shows a list of makes before the categories.
priceThe sale price, as a number without quotes.
categoryA lowercase class name such as sports or suvs. The file’s comment says to “stick with GetVehicleClass() options”; the names are listed in the reference section.
typeThe vehicle type. Cars are automobile.
shopThe key of a shop in qb-vehicleshop/config.lua.

Which shop value puts the car in PDM

The stock Config.Shops table defines five shops:

KeyBlip nameTypeJob
pdmPremium Deluxe Motorsportfree-usenone
luxuryLuxury Vehicle Shopmanagedcardealer
boatsMarina Shopfree-usenone
airAir Shopfree-usenone
truckTruck Motor Shopfree-usenone

The docs explain the two types: “A free-use shop can be accessed by any players whereas a managed shop can only be accessed by those with the configured job”. Use pdm unless your server staffs the cardealer job.

To sell one car in several shops, give shop a table. The file’s comment shows the form: {'shopname1','shopname2','shopname3'}. The stock list also contains rows with shop = 'none'. That value is not a shop key, so those vehicles stay in the shared table without appearing in any shop menu.

To stand the car on the showroom floor, set defaultVehicle and chosenVehicle of one ShowroomVehicles slot in the same config to its spawn code. The config calls defaultVehicle the “Default display vehicle”.

Why old QBCore tutorials show a hash line

Three changes to the file since 2023 explain why older tutorials no longer match it.

Date of the changeWhat changed in shared/vehicles.lua
September 27, 2023Entries keyed by model, each with a hand-written ['hash'] line in backticks, became a plain list. The commit message reads “Lessened the amount of data entry required”. The hash is now computed from model with joaat.
November 11, 2023Rows received today’s category and type fields.
May 19, 2026The table was renamed from QBShared.Vehicles to QBCore.Shared.Vehicles.

On current QBCore you do not write a hash. If your file still has keyed entries with a ['hash'] line, it predates these commits: copy the shape of the entries around yours, not the row above.

Two details in the official docs lag behind the repository, so do not be thrown by them:

  • The Shared page still calls the table QBShared.Vehicles.
  • The qb-vehicleshop page and the repository README show a ['Categories'] table inside each shop. The config.lua in the repository on November 20, 2026 has no such key. client.lua builds the category menu from the rows whose shop matches the shop you are standing in, and uses the raw category text as the menu header. A new category name appears without any other edit.

Qbox: add a vehicle to qbx_core/shared/vehicles.lua and qbx_vehicleshop

Qbox’s docs say that qbx_core/shared/vehicles.lua “already has every GTA vehicle”, so the only entries you add are add-on cars. The Qbox recipe for txAdmin places the resource in resources/[qbx]/qbx_core.

  1. Open qbx_core/shared/vehicles.lua. The whole file is one table that opens with return {. Every entry is keyed by its model name.

  2. Add your entry inside that table. The docs give this form:

    mycar = {
        name = 'My Car',
        brand = 'Custom',
        model = 'mycar',
        price = 50000,
        category = 'sports',
        type = 'automobile',
        hash = `mycar`,
    },
  3. Apply the three rules from the same page.

    • “Every entry needs a hash. Write the model name between backticks”. The page warns: “One entry without a hash stops the whole file from loading.”
    • “Model names that start with a number need brackets and quotes”, as in ['5vigero'] = { ... },.
    • “shop isn’t used.” Do not carry the shop field over from a QBCore row.
  4. Choose the shop in qbx_vehicleshop/config/shared.lua, as described below.

  5. Restart the server and read the Live Console. The docs’ rule for Lua config files is: “After editing, restart the server or the resource and check the Live Console for errors.” Errors there “usually start with SCRIPT ERROR: and name the resource and file”, so look for one that names vehicles.lua.

  6. Buy the car and park it. The menu of a showroom car has a Swap Vehicle entry that opens the shop’s Categories list. Pick the category and your car there, then choose Buy Vehicle.

The backticks are a FiveM feature, not decoration. The Cfx cookbook describes the backtick string as a literal that “will be replaced with a hash during Lua compilation time”. When qbx_core loads, it builds a second table keyed by each entry’s hash. The documented Vehicle type has seven fields: name, brand, model, price, category, type and hash.

Which Qbox shop sells the car

Shop assignment lives in the vehicles block of qbx_vehicleshop/config/shared.lua. This is the stock block, shortened to a few lines of each list:

return {
    vehicles = {
        default = 'pdm',
        categories = {
            boats = 'boats',
            air = 'air',
            -- super = { 'pdm', 'luxury' },
        },
        models = {
            -- zentorno = { 'pdm', 'luxury' },
            oppressor = 'luxury',
        },
        blocklist = {
            'police',
            'police2',
            'police3',
            'police4',
        }
    },
}

The file’s comments give the order. The shop “would first look for the vehicle in models”, then “check for the category in categories”, then “default to the default settings”. A model in blocklist is not sold. A value is one shop name or a table of names, as the commented lines show.

With no edit, an add-on car falls through to default, which is pdm. Whether players can then find it depends on a second list. Each shop has its own categories table, and the browse menu is built from that table. The stock pdm shop lists ten: sportsclassics, sedans, coupes, suvs, offroad, muscle, compacts, motorcycles, vans and cycles. It lists neither sports nor super. A car entered with category = 'sports', like the docs’ example, is assigned to pdm but has no category in that menu to appear under.

You have two ways to fix that:

  • Give the car a category the shop already lists.
  • Add the category to the shop’s categories table. The stock file’s commented-out luxury shop shows the line format: sports = 'Sports'.

Do not assign the car to luxury unless you have enabled that shop. In the stock file it is commented out and described as “an example of a managed dealership”.

To put the car on the showroom floor, change vehicle in one of the shop’s showroomVehicles rows to your model name. At startup the server logs the warning Vehicle "..." is a showroom vehicle for shop "..." but is not allowed to be bought there when a floor model is not assigned to that shop.

ESX vehicleshop: add a car to the vehicles and vehicle_categories tables

esx_vehicleshop has no Lua list. When the resource starts, it reads the vehicle_categories and vehicles tables and sends both to every client. On a server deployed from the ESX recipe, the core’s legacy.sql created those tables. The README still tells a manual install to “Import esx_vehicleshop.sql in your database”.

Current ESX also checks these tables each time the resource starts, through the SQL catalog that ships in esx_lib. The catalog creates a table that is missing and inserts every stock row whose key is not in the table yet: model for vehicles, name for vehicle_categories. Its code only inserts into those tables and has no statement that updates or deletes their rows. The rows you add stay as they are, and a stock row you delete is inserted again at the next start.

TableColumnWhat it holds
vehiclesnameThe display name. The shop sorts its list by this value.
vehiclesmodelThe spawn code. It is the primary key, so each model has one row.
vehiclespriceThe price as a whole number.
vehiclescategoryThe name of a row in vehicle_categories.
vehicle_categoriesnameThe internal category name, also a primary key.
vehicle_categorieslabelThe text shown for the category.

The stock data defines eleven categories: compacts, coupes, sedans, sports, sportsclassics, super, muscle, offroad, suvs, vans and motorcycles.

  1. Open the database in your SQL client. The MariaDB and HeidiSQL guide covers connecting to it.

  2. Choose the category. If one of the eleven stock names fits, go to step 3. To add your own, use the shape of the first category row in esx_vehicleshop.sql, written here as a statement of its own:

    INSERT INTO `vehicle_categories` (name, label) VALUES
        ('compacts','Compacts')
    ;

    Replace compacts with the name your car rows will refer to and Compacts with the label players read.

  3. Insert the car. The first vehicle row of the same file, again as its own statement:

    INSERT INTO `vehicles` (name, model, price, category) VALUES
        ('Blade','blade',15000,'muscle')
    ;

    Replace Blade with the display name, blade with the spawn code, 15000 with the price and muscle with the category name.

  4. Restart the shop by typing ensure esx_vehicleshop in the server console. The tables are read once, when the resource starts.

  5. Buy the car. The shop compares the price with the character’s cash balance, so carry the price in cash. The purchase inserts a row into owned_vehicles with your identifier, a generated plate and the hash of the model.

By default every player can buy from the menu. The README calls this “Auto mode (everyone can buy vehicles from the dealer)”, and Config.EnablePlayerManagement, which turns on the car dealer job, defaults to false.

One setting can get in the way of a test purchase. The config describes Config.LicenseEnable as “require people to own drivers license when buying vehicles?”. The two official sources disagree on its default: the ESX docs page lists true, and the config.lua in the repository sets false. Read your own file. With the setting on, a player without the license gets a notice instead of the menu. The English locale words it as “you don’t have a driver’s license!”.

Addon car not saving in the garage: what each framework checks

A garage does not look at model files. It looks for an ownership row for the vehicle, then applies checks of its own. A car spawned with /car has no such row, which is why it is refused while a car bought from the shop is not.

FrameworkMessageWhat the code checks
QBCore, qb-garages“This vehicle can’t be stored”The plate’s citizenid in player_vehicles is not yours. A spawned car has no row at all.
QBCore, qb-adminmenu“You cant store this vehicle in your garage..”/admincar did not find the car’s model hash in the shared vehicles table.
QBCore, qb-garages“You can’t store this type of vehicle here”Config.ClassSystem is on and the car’s game class is not in that garage’s list.
Qbox, qbx_garages“This vehicle can’t be stored”No vehicle id for the car, no player_vehicles row, a model missing from qbx_core/shared/vehicles.lua, the wrong garage type, or another owner.
Qbox, qbx_adminmenu“Unknown vehicle, please contact your developer to register it.”/admincar did not find the model hash in the shared vehicles table.
ESX, esx_garage“You do not own this vehicle!”No owned_vehicles row for your identifier and that plate.
ESX, esx_garage“This vehicle model does not match the owned vehicle record.”The car you are in is not the model saved in the row.

“This vehicle can’t be stored”: give the car an ownership row

Buying the car from the dealership works on all three frameworks, and it is also the test that proves the entry is right.

The admin menu resource of each framework also has an /admincar command for a car you spawned. Sit in the driver’s seat and run it.

  • QBCore: qb-adminmenu describes the command as “Save Vehicle To Your Garage (Admin Only)”. It inserts the car into player_vehicles and answers “The vehicle is now yours!”. It needs a row in qb-core/shared/vehicles.lua whose model hashes to the car you sit in, so a missing row or a misspelled model produces the refusal in the table above.
  • Qbox: qbx_adminmenu limits admincar through its saveVehicle setting, which is admin in the stock config. The command creates the vehicle through qbx_vehicles and answers “This vehicle is now yours.”
  • ESX: esx_adminmenu describes the command as “Spawn and own a vehicle, or register the vehicle you are driving.” It inserts the car into owned_vehicles and answers “Vehicle registered to you.” It reads the model from the car itself and never looks at the vehicles table, so it also works for a car that is not for sale. The command is refused without the admin menu’s vehicleOwnership permission.

Keep the entry for as long as anyone owns the car

On Qbox, the garage decides a vehicle’s type from its entry in qbx_core/shared/vehicles.lua. An owned car whose entry you delete can no longer be parked, and it is left out of the garage’s vehicle list. To stop selling a car, add its model to blocklist on Qbox, or set shop = 'none' on QBCore, and leave the entry where it is.

Categories also pick the garage

  • Qbox: a car whose category is helicopters or planes belongs in air garages, boats in sea garages, and every other category in car garages.
  • QBCore: Config.ClassSystem in qb-garages is false by default, described as “false == any vehicle class in any garage”. If you turn it on, the garage list is filtered through the 23 category names in the reference section, and a car with any other category name is left out of the list.

Reference: vehicle types and category names

The type field feeds the server-side native that creates the vehicle. Its reference lists the accepted values: automobile, bike, boat, heli, plane, submarine, trailer, and “(potentially)” train. It adds that the value “should be the same type as the type field in vehicles.meta”.

  • QBCore without a type: qb-vehicleshop and qb-garages fall back to the category. motorcycles becomes bike, boats becomes boat, helicopters becomes heli, planes becomes plane and submarines becomes submarine, while trailer and train keep their names. Every other category becomes automobile.
  • Qbox without an entry: the spawn helper in qbx_core creates a temporary vehicle to read the type, and warns No vehicle type found for model: followed by the name and temp vehicle was created and taken in type. Add the entry to remove the warning.

These are the category names that qb-garages maps to the game’s vehicle class numbers. The stock QBCore and Qbox lists use the same spellings.

ClassCategoryClassCategory
0compacts12vans
1sedans13cycles
2suvs14boats
3coupes15helicopters
4muscle16planes
5sportsclassics17service
6sports18emergency
7super19military
8motorcycles20commercial
9offroad21trains
10industrial22openwheel
11utility

FiveM Legacy and FiveM for GTAV Enhanced

Nothing in these entries names a platform: they hold model names, prices, categories and types. txAdmin’s recipe list for Enhanced includes both ESX Legacy and Qbox.

The car resource is where the platforms differ. On Enhanced, a stream_enhanced folder is loaded instead of stream when a resource has one, which the Cfx docs say lets “a single resource” stay “cross-compatible”. The dealership entry only refers to the model by name. Converting the model files is covered in converting assets with Alchemist.

Troubleshooting

Addon car not showing in the QBCore vehicle shop (PDM)

Check the shop value first. The menu compares it with the key of the shop you are standing in, so it must be spelled exactly like the key in Config.Shops, for example 'pdm'. Then confirm the server was restarted after the edit. A car assigned to luxury is sold only through the cardealer job, because that shop is managed.

Addon car not showing in the Qbox vehicle shop

Work through the lookup order. If the model is in blocklist, it is not sold. If models or categories sends it to a shop that is commented out, such as the stock luxury, no shop sells it. If it lands in pdm, its category must be one of the keys in that shop’s categories table.

SCRIPT ERROR in vehicles.lua after the edit

Qbox’s docs name the usual cause, “A missing comma or bracket is the most common mistake”, and give three rules for Lua tables: “Every entry ends with a comma, including the last one”, every opening brace “needs a matching” closing brace, and “Text goes in quotes” while numbers do not. Their example of what a broken file prints is SCRIPT ERROR: @qbx_core/shared/jobs.lua:57: '}' expected (to close '{' at line 3) near 'police', which they read as: at line 57 of that file, a brace is missing. Their advice is to go to that line “and look just above it”. On Qbox, also check that the new entry has its hash line.

ESX vehicle shop is empty or the new car is missing

Three things in the code keep a car out of the ESX shop.

  • The category has no match. The loading query joins vehicles to vehicle_categories on the category name. MariaDB’s documentation says such a join returns “only rows that have a match in both tables”, so a car with a misspelled category is not loaded. If nothing loads at all, the server console prints [esx_vehicleshop] No vehicles matched the catalog. Check vehicles and their matching vehicle_categories entries. The shop menu then stays closed, and the client console, which opens with F8, prints an error that reads Vehicleshop has, a zero, then vehicles, please add some!.
  • The game does not know the model. Each client drops those rows and prints a warning that reads Ignoring vehicle, then the model name, then due to invalid Model. The print is in a client file, so it also shows in the F8 console. Either the car resource is not running or the model value is not the spawn code.
  • The shop was not restarted. Run ensure esx_vehicleshop after every change to the two tables.

Next Steps

Official documentation and repository references