How to Add Addon Cars to the ESX Vehicle Shop (esx_vehicleshop SQL, Step by Step)

ESX keeps its shop cars in the database, not in a config file. Convert the mod, install the resource, insert one row into the vehicles table with a category that exists, restart esx_vehicleshop and the car is for sale.

Published 7 min read4 sections

In ESX Legacy the vehicle shop reads its stock from two database tables. There is no vehicles file to edit: you add a row with SQL, restart one resource and the car is in the menu. This guide starts at the gta5-mods.com page and ends with the car bought from esx_vehicleshop.

You need: an ESX Legacy server with esx_vehicleshop installed, file access to resources, access to the server's MySQL/MariaDB database (HeidiSQL, phpMyAdmin or your host's database panel) and an ESX admin account for the test spawn. The example spawn name is gtr35.

Step 1: Convert the car and note the spawn name

Paste the gta5-mods.com page link into the converter and download the zip. The first 3 conversions are free; after that it is a one-time $15 for unlimited conversions. The zip holds one resource folder with fxmanifest.lua, a common/ folder with the meta files and a stream/ folder with the models and textures.

The spawn name is <modelName> in common/vehicles.meta, the same as the main .yft file name in stream/. Note it in lowercase. The Resource Inspector shows it without opening any file; spawn name and model hash explains what it is.

Step 2: Install the resource and ensure it

text
resources/
└── [cars]/
    └── gtr35/
        ├── fxmanifest.lua
        ├── common/
        └── stream/

Add the category to server.cfg. In the stock ESX Legacy config the framework lines look like this; only the last line is new:

cfg
ensure oxmysql
ensure esx_lib
ensure es_extended
ensure [core]
ensure [cars]

ensure [cars] starts every resource inside the bracket folder. Panel users: installing cars via txAdmin covers the upload and the config editor.

Step 3: Check that it spawns

Restart the server, or run refresh and ensure gtr35 in the console. In game:

text
/car gtr35

/car is an es_extended command for the admin and owner groups by default. This step matters more on ESX than elsewhere: esx_vehicleshop hides any shop vehicle whose model the game cannot find, so a car that does not spawn will never appear in the shop, no matter what the database says. If it does not spawn, fix that first with the invisible car guide.

Step 4: Pick a category that exists

Run this to see the categories your server has:

sql
SELECT * FROM vehicle_categories;

A stock install returns compacts, coupes, sedans, sports, sportsclassics, super, muscle, offroad, suvs, vans and motorcycles. The name column is what you reference; label is what players read.

To put your imports in a category of their own, create it first:

sql
INSERT INTO `vehicle_categories` (`name`, `label`) VALUES
  ('imports', 'Imports');

Warning

If either query fails with "table doesn't exist", the shop's SQL was never imported. Import esx_vehicleshop.sql from the esx_vehicleshop folder (or legacy.sql from the ESX Legacy package on a fresh install) before you continue.

Step 5: Insert the car into the vehicles table

sql
INSERT INTO `vehicles` (`name`, `model`, `price`, `category`) VALUES
  ('Nissan GT-R R35', 'gtr35', 185000, 'sports');
ColumnWhat to put there
nameDisplay name in the shop menu, up to 60 characters.
modelThe spawn name from step 1, lowercase. It is the table's primary key, so each model can exist only once.
priceWhole number.
categoryA name from vehicle_categories, exactly as stored there.

Several cars go into one statement, separated by commas:

sql
INSERT INTO `vehicles` (`name`, `model`, `price`, `category`) VALUES
  ('Nissan GT-R R35', 'gtr35', 185000, 'sports'),
  ('BMW M4 Competition', 'm4comp', 160000, 'coupes');

Now run the same join the shop runs. If this returns your car, the database side is correct:

sql
SELECT v.name, v.model, v.price, c.label
FROM vehicles v
JOIN vehicle_categories c ON v.category = c.name
WHERE v.model = 'gtr35';

An empty result with the row present in vehicles means the category does not match anything in vehicle_categories.

Step 6: Restart esx_vehicleshop and buy the car

esx_vehicleshop loads both tables when it starts and sends the list to every connected player. The car resource has to be running first, then:

text
ensure gtr35
restart esx_vehicleshop

No full server restart is needed. Walk to the shop marker, open the menu, move to the category and scroll to the car. With Config.EnablePlayerManagement = false (the default in config.lua) any player can buy directly. With it set to true the shop runs through the cardealer job, so you need that job to test.

Not showing up? Check these in order

  1. Open the F8 console after opening the shop. esx_vehicleshop prints Ignoring vehicle gtr35 due to invalid Model for every row whose model is not streamed. If you see that line, the SQL is fine and the car resource is not running, or model does not match the spawn name.
  2. Run the join query from step 5. No result means a category mismatch: 'Sports' versus 'sports', a typo, or a category you forgot to create.
  3. Did you restart esx_vehicleshop after the insert? The tables are read once at resource start.
  4. Did the insert run on the right database? Compare the database name in mysql_connection_string in server.cfg with the one open in your SQL client.
  5. "Duplicate entry" on insert? A row with that model already exists. Use UPDATE vehicles SET price = 185000, category = 'sports' WHERE model = 'gtr35'; instead.
  6. Was the car resource started after you joined? Restart esx_vehicleshop once more so the list is sent again, or reconnect.
  7. Player management is on. With Config.EnablePlayerManagement = true a normal player cannot buy from the menu on their own.
  8. /car fails too. Then it is not an ESX problem. Check the resource with the Resource Inspector and the server console output with the Error Analyzer.

The name shows as NULL in the garage

The shop menu uses the name column, but a bought vehicle is saved in owned_vehicles as a model hash, and esx_garage asks the game for the display name of that model. The converted resource does not ship a display-name script, so GTA has no text for the car's label and prints NULL wherever a script asks the game for the vehicle name. Open common/vehicles.meta, find the <gameName> value for your car, then add a small client script to the car resource:

lua
-- vehicle_names.lua (inside the car resource)
CreateThread(function()
    -- first argument: the <gameName> value from vehicles.meta
    AddTextEntry('GTR35', 'Nissan GT-R R35')
end)

Then register it in the resource's fxmanifest.lua:

lua
client_script 'vehicle_names.lua'

The Vehicles.meta Generator writes this file for you if you are building the metas from scratch.

FAQ

Is there a vehicles.lua in ESX?

Not for esx_vehicleshop. Its stock comes from the vehicles and vehicle_categories tables. Third-party shops for ESX often use their own config file; check that script's documentation.

Does the model have to be lowercase?

The game hashes model names without regard to case, and the stock ESX data even contains an uppercase model. Lowercase is still the safe habit: it matches the file names in stream/ and avoids two rows that differ only by case.

How do I remove a car from the shop?

DELETE FROM vehicles WHERE model = 'gtr35'; then restart esx_vehicleshop. Cars that players already own stay in owned_vehicles and keep working as long as the resource is still streamed.

Can I add a whole car pack at once?

Yes. Build the pack with the Car Pack Builder, take the spawn names from its list or from the Vehicle List tool, and write one multi-row insert as in step 5.

Do I need to restart the whole server?

Not for shop changes. A new car resource needs refresh and ensure, and a database change needs restart esx_vehicleshop.

Other frameworks

See the same walkthrough for QBCore and Qbox, the panel side in installing cars via txAdmin, and the general install guide.

Sources

Checked on 2026-10-10.

Have a gta5-mods.com link ready?

Paste it into the converter and download a FiveM resource with the stream folder, meta files and fxmanifest.lua in place.

  • 3 conversions free, no account needed
  • 2 more free if you leave an email
  • After that: $15 once for unlimited conversions and the Pro tools, no subscription