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:
-
Find the car's spawn name (
<modelName>invehicles.meta). -
QBCore: add the car to
qb-core/shared/vehicles.lua. -
ESX: add the car to the
vehiclestable in your database. - Restart the server.
Jump to

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' },-
modelis the spawn name. -
nameandbrandare what players see in the shop. -
priceis the price in your server's money. -
categoryis the shop category, use one that already exists in the file (for examplesports,suvs,sedans). -
typeisautomobilefor cars,bikefor motorbikes,boat,heliorplanefor the rest. -
shopis the dealership it's sold in,pdmis 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');-
nameis what players see in the shop. -
modelis the spawn name. -
priceis the price. -
categoryhas to be one of the categories in thevehicle_categoriestable.
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.
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 commentaire