How to Add Cars to QBCore and ESX Vehicle Shops

Once a car is installed and spawns, you can add it to your server's dealership (vehicle shop) so players can buy it. Here's how on QBCore and ESX.

TL;DR:

  1. Find the car's spawn name (<modelName> in vehicles.meta).
  2. QBCore: add the car to qb-core/shared/vehicles.lua.
  3. ESX: add the car to the vehicles table in your database.
  4. Restart the server.

QBCore shared vehicles.lua entry and ESX vehicles SQL insert for a custom car

1. Find the spawn name

You'll need the car's spawn name. It's the <modelName> in the resource's data/vehicles.meta. See How to Find a Vehicle's Spawn Name.

2. QBCore

Open qb-core/shared/vehicles.lua and add a line for the car to the list, next to the other cars:

{ model = 'dlsentinel', name = 'Sentinel', brand = 'Ubermacht', price = 25000, category = 'coupes', type = 'automobile', shop = 'pdm' },
  • model is the spawn name.
  • name and brand are what players see in the shop.
  • price is the price in your server's money.
  • category is the shop category, use one that already exists in the file (for example sports, suvs, sedans).
  • type is automobile for cars, bike for motorbikes, boat, heli or plane for the rest.
  • shop is the dealership it's sold in, pdm is the default one.

Save the file and restart the server.

3. ESX

The ESX vehicle shop reads its cars from the vehicles table in your database. Open your database with a tool like HeidiSQL and run:

INSERT INTO vehicles (name, model, price, category) VALUES ('Sentinel', 'dlsentinel', 25000, 'coupes');
  • name is what players see in the shop.
  • model is the spawn name.
  • price is the price.
  • category has to be one of the categories in the vehicle_categories table.

Restart the server (or the vehicle shop resource) so it loads the new car.

Adding a whole pack

For car packs, open the pack's vehicles.meta, copy every <modelName> and add one line per car the same way. Using a lore friendly brand name like Ubermacht or Pfister in the shop fits debadged and lore friendly cars best.

If a car shows up in the shop but won't spawn after buying it, see Vehicle Not Spawning in FiveM.

↑ Back to the steps

FAQ

Do I need to restart the whole server?

On QBCore, yes, because the vehicle list is loaded by qb-core when the server starts. On ESX, restarting the vehicle shop resource is usually enough.

Which category should I use?

Use a category that already exists. On QBCore look at the other cars in vehicles.lua, on ESX check the vehicle_categories table.

The car is in the shop but won't spawn after buying it. Why?

The model name in the shop doesn't match the spawn name, or the car resource isn't started. See our guide on vehicles not spawning.

Can I sell a car in a different dealership on QBCore?

Yes. Change the shop value to the name of the dealership you want, for example a luxury or boat shop set up in your config.

0 comments

Leave a comment

Please note, comments need to be approved before they are published.