Skip to content
GuidesVehiclesRoleplayServer Setup

How to Add Cars to QBCore, Qbox and ESX Vehicle Shops

· 8 min read

How to Add Cars to QBCore, Qbox and ESX Vehicle Shops

Installing an add-on car and selling it are two separate jobs. The first makes the model exist on the server. The second tells your framework that the model has a name, a price and a category, so the dealership, the garage and the keys script all know what it is. This post covers the second job on QBCore, Qbox and ESX.

Before you start

Make sure the car spawns. If /car spawncode does nothing, the problem is the install, not the shop — go back to our custom car install guide or how to spawn vehicles. You need one thing from that step: the car's spawn code. On Goodara it is printed on every product page and in the readme.

QBCore: shared/vehicles.lua

QBCore keeps every sellable vehicle in qb-core/shared/vehicles.lua. Add one line per car to the Vehicles table:

{ model = 'spawncode', name = 'Display Name', brand = 'Brand', price = 85000, category = 'sports', type = 'automobile', shop = 'pdm' },
  • model — the spawn code, exactly as the car spawns. Lowercase.
  • name and brand — what players see in the shop and garage.
  • price — what the dealership charges.
  • category — must be a category your shop lists (compacts, sedans, suvs, sports, super, muscle, motorcycles and so on).
  • type — automobile for cars, bike for motorcycles, boat or heli for those.
  • shop — which showroom sells it. In the default qb-vehicleshop config, pdm is the standard dealership and luxury the high-end one. Use none for job vehicles that should exist but not be sold.

You do not need to add a hash: the file generates it from the model name. Save, then restart the server, because other resources read this table when they start.

Qbox: the same idea, a different shape

Qbox keeps its list in qbx_core/shared/vehicles.lua, keyed by the spawn code, and here you do write the hash, using backticks:

spawncode = {
    name = 'Display Name',
    brand = 'Brand',
    model = 'spawncode',
    price = 85000,
    category = 'sports',
    type = 'automobile',
    hash = `spawncode`,
},

Which showroom sells the car is set in the vehicle shop resource's own config rather than in this file, so check there if the car is registered but not on display.

ESX: two database tables

esx_vehicleshop reads from the database instead of a Lua file. Cars live in the vehicles table and the categories they belong to in vehicle_categories. Add a row with your database tool, or run:

INSERT INTO vehicles (name, model, price, category)
VALUES ('Display Name', 'spawncode', 85000, 'sports');

The category value has to match the name of a row in vehicle_categories. If you are adding a new category, insert it there first with a name and a label. Restart esx_vehicleshop afterwards so it reloads the list. Paid dealership scripts often use their own tables or config, so if you are not on the stock shop, follow that script's documentation.

Why the car is called NULL

If the car drives fine but the game shows "NULL" where its name should be, that is not a shop problem. The on-screen name comes from the gameName value in the car's vehicles.meta, and the game looks that value up as a text label. When no label exists, you get NULL. The fix is a one-line client script in any resource:

AddTextEntry('GAMENAME', 'Display Name')

Replace GAMENAME with the car's gameName. Many cars ship with this already done; the Goodara toy cars, for instance, have their in-game display names set.

Then: garage, keys and job fleets

  • Garage: most garage scripts read the same vehicle list, so a correctly registered car stores and retrieves without extra work. See our garage guide.
  • Keys: buy the car from the shop as a normal player and confirm you receive keys — vehicle keys guide.
  • Police and EMS: job vehicles are not sold. Add their spawn codes to the job's own list instead, such as Config.AuthorizedVehicles in qb-policejob. Our police & EMS guide covers it.

Adding a whole pack

A pack is the same job repeated. Keep the spawn codes in a spreadsheet with a name, price and category for each, then paste the finished lines in one go rather than editing the live file car by car. Price by tier, not by taste: decide what a sedan, a sports car and a supercar cost on your server and slot each model into a tier. With certified lore-friendly packs, use the GTA V-style name from the product title as the name and brand, so the shop, the garage and the car all agree.

Quick checklist

  • The car spawns by its spawn code.
  • The model in the list matches that spawn code exactly.
  • The category exists in your shop.
  • You restarted after editing.
  • A non-admin test character can buy it, store it and get it back.

The cars themselves are the same on every framework — browse the add-on cars or start with a pack, and read how a dealership fits together if you have not picked a shop script yet.

Buying for this? Read the buyer's guide: FiveM Cars for QBCore & ESX ›

Keep reading