Configuration
Files you can edit:
shared/config.lua: settings, the dealership spots and keysshared/vehicles/vanilla.lua: the cars, prices and categoriesshared/vehicles/example.lua: a template for a new dealership's car list
Settings
| Option | Default | What it does |
|---|---|---|
Config.Debug | false | Extra messages in F8 and the server console |
Config.TestDriveTime | 0.30 | Test drive length in minutes |
Config.BucketBase | 200000 | Private showroom worlds use this + player id; keep clear of other scripts' buckets |
Config.HideDisplayNearMenu | 15.0 | Hides parked display cars this close (meters) to the menu car while the menu is open, for that player only. 0 keeps them visible |
Config.UseTarget | true | Use 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.PhotoSpot | vector3(-1336.0, -3044.0, 13.9) | Where /dealerphotos takes its pictures: open, flat ground (the airport runway) |
Config.RotateStockDefault | true | Draw 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:
| Field | What it does |
|---|---|
position | The entrance marker / target spot |
spawn | Where the car you browse stands |
testdrive | Where test drives start |
purchase | Where a bought car appears |
blip | Map blip: position, sprite, scale, color, name |
showroom | Parked display cars: { model, position } |
categories | The categories its cars use: { name, label } |
vehicles | Which car file it sells: 'vanilla' uses shared/vehicles/vanilla.lua |
rotateStock | Optional: 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:
| Field | What it does |
|---|---|
model | The car's spawn name |
class | Class letter shown with the car |
price | Price |
category | One of the dealership's categories |
color | Fallback 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
- Copy
shared/vehicles/example.luato a new name, e.g.sports.lua, and changeVehicles.exampleto the same name (Vehicles.sports). - Remove the
--in front of every line below the dashed line, and edit the cars. - Uncomment the example dealership at the end of
Config.Locationsinshared/config.lua, set your own coordinates, and set itsvehicles = 'sports'. - Restart the resource, then take pictures of the new cars with
/dealerphotos missing.