Documentation
R_Vehicleshop

r_vehicleshop Adding Vehicles

Add categories, base-game and add-on vehicles to r_vehicleshop, use your framework's vehicle list, and set stats, showcase cars, boats and aircraft.

Every shop in config.lua has a Categories list and a Vehicles table. Categories are the tabs of the vehicle list; Vehicles holds one list per category key.

Categories

Categories = {
    { key = 'super', label = 'Super' },
    { key = 'sports', label = 'Sports' },
    { key = 'motorcycles', label = 'Motorcycles' },
},
  • key: the name of the list inside Vehicles
  • label: what players see
  • image: optional picture for the tab; by default the first vehicle of the category is shown (falling back to the next ones if its picture is missing)
  • icon: optional, only shown when no picture can be loaded: one of car, car-front, zap, gauge, flame, mountain, truck, bus, bike, ship, sailboat, plane, tractor, caravan, star, crown, rocket, anchor (default car)

The order of the list is the order of the tabs. A category with an empty list still shows up with 0 vehicle(s). Remove it from Categories to hide it. A shop with a single category skips the category list and opens straight on its vehicles.

Base-game vehicles

Only the model and the price are needed. The brand, the display name and the image are read from the game:

Vehicles = {
    super = {
        { model = 'adder', price = 900000 },
        { model = 'zentorno', price = 725000 },
    },
},

Images come from https://docs.fivem.net/vehicles/<model>.webp, which has a picture of every base-game vehicle.

Add-on vehicles

Add-ons usually have no display name or image in the game, so set them yourself:

{ model = 'mycar', label = 'My Car', brand = 'My Brand', price = 50000, image = 'https://example.com/mycar.png' },
KeyRequiredNotes
modelyesspawn name of the vehicle
priceyesprice in your currency
labelnooverrides the name from the game
brandnooverrides the make from the game
imagenooverrides the image URL (any https:// image works, .png or .webp recommended)

A model that isn't streamed on the server is skipped silently, so a shared config works across servers with different add-on packs. Set R.Debug = true to print skipped models to the client console (F8).

Use your framework's vehicle list

QBCore and QBX already keep a vehicle list with brand, name, price and category (qb-core/shared/vehicles.lua, qbx_core/shared/vehicles.lua), and ESX servers running esx_vehicleshop have the vehicles table. Set UseFrameworkVehicles = true on a shop and its catalog is filled from that list. No duplicate price lists to maintain:

pdm = {
    -- ...
    UseFrameworkVehicles = true,
    Categories = {
        { key = 'super', label = 'Super' },
        { key = 'sports', label = 'Sports' },
        { key = 'sportsclassics', label = 'Sports Classics' },
    },
    Vehicles = {
        super = {
            { model = 'adder', price = 1500000 },   -- overrides the framework price
            { model = 'mycar', label = 'My Car', brand = 'Brand', price = 50000, image = 'https://...' },
        },
    },
},
  • Every vehicle whose framework category matches one of the shop's Categories keys is listed, sorted by name. Categories not in the list (e.g. emergency, military) are left out.
  • Vehicles entries are added on top and win over the framework entry of the same model, so you can override a price, rename something or add add-ons that aren't in the shared list.
  • R.Blocklist in config.lua removes models you never want sold.

The framework list is read once when the resource starts. After editing shared/vehicles.lua or the vehicles table, restart r_vehicleshop.

Stats

Top speed, acceleration, braking and handling are computed from the vehicle's handling data when the showroom opens. Nothing to configure per vehicle. If your add-on pack has very fast vehicles, raise R.Stats.maxSpeed (and the other max* values) so their bars don't all hit 100 %.

Showcase vehicles

Parked display vehicles around the shop. They are spawned locally for players within R.ShowcaseRange, frozen and locked, and targeting one opens the showroom on that model:

Showcase = {
    { Model = 'elegy2', Coords = vector4(-37.0104, -1092.8065, 26.8779, 177.5585) },
    { Model = 'vacca', Coords = vector4(-42.3511, -1101.5804, 26.7262, 356.4317) },
},

Use a model that is also in the shop's Vehicles list. Then the showroom opens straight on it with the price and stats. Any vehicle works as decoration otherwise.

Boats, bikes & aircraft

Any vehicle class works. The showroom spawns whatever model you list, so for a boat shop point Showroom, TestDrive and Delivery at water. The pre-configured boats shop at Los Santos Marina is a ready example. On ESX the vehicle type column (car / boat / aircraft) is filled in automatically from the model.