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.

- 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
On this page
- Direct Answer
- Where QBCore, Qbox and ESX keep the dealership list
- Before you edit: confirm the spawn code
- Add a car to a QBCore dealership in qb-core/shared/vehicles.lua
- Qbox: add a vehicle to qbx_core/shared/vehicles.lua and qbx_vehicleshop
- ESX vehicleshop: add a car to the vehicles and vehicle_categories tables
- Addon car not saving in the garage: what each framework checks
- Reference: vehicle types and category names
- FiveM Legacy and FiveM for GTAV Enhanced
- Troubleshooting
- Next Steps
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.
| QBCore | Qbox | ESX Legacy | |
|---|---|---|---|
| Car list | qb-core/shared/vehicles.lua | qbx_core/shared/vehicles.lua | vehicles and vehicle_categories database tables |
| Dealership resource | qb-vehicleshop | qbx_vehicleshop | esx_vehicleshop |
| What puts a car in a shop | The shop value in the car’s row | The vehicles block of qbx_vehicleshop/config/shared.lua | Nothing extra: the shop lists every row it loads |
| Ownership table | player_vehicles | player_vehicles | owned_vehicles |
| Garage resource | qb-garages | qbx_garages | esx_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
- Install and start the car resource. Until the car spawns, nothing below can be checked.
- Spawn it by name. QBCore, Qbox and ESX each register an admin command named
carthat takes a model name. The Qbox docs give/car sultanas the example. On Qbox, run/optinfirst, because its docs say admin commands work “after /optin”. - 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
modelvalue “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.
-
Open
qb-core/shared/vehicles.luaand find the linelocal Vehicles = {. Each row between that line and its closing brace is one vehicle. -
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.
-
Set the seven values with the table below.
-
Restart the server.
qb-coreloads the file as one of its shared scripts, andqb-vehicleshopandqb-garageseach read the vehicle table when they start. A full restart refreshes all three. -
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.
| Field | What to enter |
|---|---|
model | The spawn code. |
name | The display name players see. |
brand | The make. With Config.FilterByMake turned on in qb-vehicleshop, the shop shows a list of makes before the categories. |
price | The sale price, as a number without quotes. |
category | A 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. |
type | The vehicle type. Cars are automobile. |
shop | The 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:
| Key | Blip name | Type | Job |
|---|---|---|---|
pdm | Premium Deluxe Motorsport | free-use | none |
luxury | Luxury Vehicle Shop | managed | cardealer |
boats | Marina Shop | free-use | none |
air | Air Shop | free-use | none |
truck | Truck Motor Shop | free-use | none |
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 change | What changed in shared/vehicles.lua |
|---|---|
| September 27, 2023 | Entries 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, 2023 | Rows received today’s category and type fields. |
| May 19, 2026 | The 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-vehicleshoppage and the repository README show a['Categories']table inside each shop. Theconfig.luain the repository on November 20, 2026 has no such key.client.luabuilds the category menu from the rows whoseshopmatches the shop you are standing in, and uses the rawcategorytext 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.
-
Open
qbx_core/shared/vehicles.lua. The whole file is one table that opens withreturn {. Every entry is keyed by its model name. -
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`, }, -
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
shopfield over from a QBCore row.
-
Choose the shop in
qbx_vehicleshop/config/shared.lua, as described below. -
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. -
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
categoriestable. The stock file’s commented-outluxuryshop 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.
| Table | Column | What it holds |
|---|---|---|
vehicles | name | The display name. The shop sorts its list by this value. |
vehicles | model | The spawn code. It is the primary key, so each model has one row. |
vehicles | price | The price as a whole number. |
vehicles | category | The name of a row in vehicle_categories. |
vehicle_categories | name | The internal category name, also a primary key. |
vehicle_categories | label | The text shown for the category. |
The stock data defines eleven categories: compacts, coupes, sedans, sports, sportsclassics, super, muscle, offroad, suvs, vans and motorcycles.
-
Open the database in your SQL client. The MariaDB and HeidiSQL guide covers connecting to it.
-
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
compactswith the name your car rows will refer to andCompactswith the label players read. -
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
Bladewith the display name,bladewith the spawn code,15000with the price andmusclewith the category name. -
Restart the shop by typing
ensure esx_vehicleshopin the server console. The tables are read once, when the resource starts. -
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_vehicleswith 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.
| Framework | Message | What 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-adminmenudescribes the command as “Save Vehicle To Your Garage (Admin Only)”. It inserts the car intoplayer_vehiclesand answers “The vehicle is now yours!”. It needs a row inqb-core/shared/vehicles.luawhosemodelhashes to the car you sit in, so a missing row or a misspelledmodelproduces the refusal in the table above. - Qbox:
qbx_adminmenulimitsadmincarthrough itssaveVehiclesetting, which isadminin the stock config. The command creates the vehicle throughqbx_vehiclesand answers “This vehicle is now yours.” - ESX:
esx_adminmenudescribes the command as “Spawn and own a vehicle, or register the vehicle you are driving.” It inserts the car intoowned_vehiclesand answers “Vehicle registered to you.” It reads the model from the car itself and never looks at thevehiclestable, so it also works for a car that is not for sale. The command is refused without the admin menu’svehicleOwnershippermission.
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
helicoptersorplanesbelongs in air garages,boatsin sea garages, and every other category in car garages. - QBCore:
Config.ClassSysteminqb-garagesisfalseby 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-vehicleshopandqb-garagesfall back to the category.motorcyclesbecomesbike,boatsbecomesboat,helicoptersbecomesheli,planesbecomesplaneandsubmarinesbecomessubmarine, whiletrailerandtrainkeep their names. Every other category becomesautomobile. - Qbox without an entry: the spawn helper in
qbx_corecreates a temporary vehicle to read the type, and warnsNo vehicle type found for model:followed by the name andtemp 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.
| Class | Category | Class | Category |
|---|---|---|---|
| 0 | compacts | 12 | vans |
| 1 | sedans | 13 | cycles |
| 2 | suvs | 14 | boats |
| 3 | coupes | 15 | helicopters |
| 4 | muscle | 16 | planes |
| 5 | sportsclassics | 17 | service |
| 6 | sports | 18 | emergency |
| 7 | super | 19 | military |
| 8 | motorcycles | 20 | commercial |
| 9 | offroad | 21 | trains |
| 10 | industrial | 22 | openwheel |
| 11 | utility |
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
vehiclestovehicle_categorieson 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 readsVehicleshop has, a zero, thenvehicles, 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, thendue 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 themodelvalue is not the spawn code. - The shop was not restarted. Run
ensure esx_vehicleshopafter every change to the two tables.
Next Steps
- For the resource side of the job, go back to how to add addon cars to a FiveM server.
- Check the size of the car’s files against the oversized assets guide before players start buying it.
- Moving a QBCore vehicle list to Qbox is one step of migrating QBCore to Qbox.
- For more cars to register this way, browse FiveCrate’s addon vehicles.
Browse Addon vehicles
Addon vehicles with custom handling, audio and visual modifications for FiveM servers.
Official documentation and repository references
- QBCore Docs: Shared (Vehicles)
- QBCore Docs: qb-vehicleshop
- Qbox Docs: Migrating from QBCore, server setup (Vehicles)
- ESX Docs: esx_vehicleshop
- QBCore: qb-core shared/vehicles.lua
- Qbox: qbx_core shared/vehicles.lua
- Qbox: qbx_vehicleshop config/shared.lua
- ESX Legacy Addons: esx_vehicleshop (SQL and source)
Related guides
How to Give Yourself Admin on QBCore, Qbox and ESX
How to give yourself admin on QBCore, Qbox and ESX Legacy: the add_principal lines, setgroup, /addpermission and /optin, plus fixes for Access denied errors.
FiveM Addon Car Not Spawning or Invisible: Causes and Fixes
Fix a FiveM addon car not spawning: check in order whether the resource, vehicles.meta and the stream files loaded, then fix invisible cars and NULL names.
How to Add Addon Cars to a FiveM Server
How to add cars to a FiveM server: stream folder, vehicles.meta and data_file lines in fxmanifest.lua, ensure, a spawn test, pack merging and Enhanced.
How to Migrate QBCore to Qbox Safely (With a Rollback Plan)
Migrate QBCore to Qbox on a test copy: what carries over, the database and qb-inventory conversion commands, go-live day and a rollback plan from Qbox's docs.
QBCore vs ESX vs Qbox: Which FiveM Framework in 2026?
QBCore vs ESX vs Qbox in 2026, from official sources: what QBCore leaving FiveM means, how Qbox and ESX Legacy differ, and which framework fits your scripts.




