Configuration

Files you can edit:

  • shared/config.lua: settings, the dealership spots and keys
  • shared/vehicles/vanilla.lua: the cars, prices and categories
  • shared/vehicles/example.lua: a template for a new dealership's car list

Settings

OptionDefaultWhat it does
Config.DebugfalseExtra messages in F8 and the server console
Config.TestDriveTime0.30Test drive length in minutes
Config.BucketBase200000Private showroom worlds use this + player id; keep clear of other scripts' buckets
Config.HideDisplayNearMenu15.0Hides parked display cars this close (meters) to the menu car while the menu is open, for that player only. 0 keeps them visible
Config.UseTargettrueUse ox_target, qb-target or fusing-target at each entrance when one is running; otherwise an [E] prompt
Config.DefaultGarage'pillboxgarage'QBCore: the garage bought cars are stored in
Config.PhotoSpotvector3(-1336.0, -3044.0, 13.9)Where /dealerphotos takes its pictures: open, flat ground (the airport runway)
Config.RotateStockDefaulttrueDraw a fresh set of display cars from each dealership's cars on every restart

Keys

qb-vehiclekeys and qbx_vehiclekeys work automatically. For another keys script, remove the -- in front of its one line in Config.GiveKeys:

Config.GiveKeys = function(vehicle, plate)
    exports.wasabi_carlock:GiveKey(plate)
end

Ready-made lines are included for wasabi_carlock, qs-vehiclekeys, jaksam vehicles_keys, mk_vehiclekeys, cd_garage, okokGarage and t1ger_keys.

Locations

Each dealership in Config.Locations:

FieldWhat it does
positionThe entrance marker / target spot
spawnWhere the car you browse stands
testdriveWhere test drives start
purchaseWhere a bought car appears
blipMap blip: position, sprite, scale, color, name
showroomParked display cars: { model, position }
categoriesThe categories its cars use: { name, label }
vehiclesWhich car file it sells: 'vanilla' uses shared/vehicles/vanilla.lua
rotateStockOptional: false pins the display to the models in its showroom block
{
    position = vector3(-57.04, -1097.2, 26.42),
    spawn = vector4(-41.85, -1099.43, 26.42, 131.74),
    testdrive = vector4(-49.63, -1109.79, 26.44, 67.54),
    purchase = vector4(-29.62, -1087.8, 26.42, 337.79),
    blip = { position = vector3(-57.04, -1097.2, 26.42), sprite = 225, scale = 0.7, color = 3, name = 'Vanilla Dealership' },
    showroom = {
        { model = 'infernus', position = vector4(-38.32, -1096.82, 25.40, 199.95) },
    },
    categories = {
        { name = 'compact', label = 'Compact' },
        { name = 'super', label = 'Super' },
    },
    vehicles = 'vanilla',
},

Cars

Each car in the dealership's car file:

FieldWhat it does
modelThe car's spawn name
classClass letter shown with the car
pricePrice
categoryOne of the dealership's categories
colorFallback color if the player does not pick one
Vehicles.vanilla = {
    {
        model = 'asbo',
        class = 'A',
        price = 9500,
        category = 'compact',
        color = { r = 0, g = 0, b = 0 }
    },
}

Adding a dealership

  1. Copy shared/vehicles/example.lua to a new name, e.g. sports.lua, and change Vehicles.example to the same name (Vehicles.sports).
  2. Remove the -- in front of every line below the dashed line, and edit the cars.
  3. Uncomment the example dealership at the end of Config.Locations in shared/config.lua, set your own coordinates, and set its vehicles = 'sports'.
  4. Restart the resource, then take pictures of the new cars with /dealerphotos missing.