LCK Dealership
Install and configure dealerships, searchable vehicle catalogs, showroom previews, test drives, financing, ownership persistence, catalog administration, and interface themes.
Installation
- Keep the resource folder named exactly
lck-dealership. - Import
sql/install.sql. The resource also creates its four private tables when missing. - Review the framework ownership mapping and QB default garage in
config.lua. - Configure dealership coordinates, catalog vehicles, prices, and stock.
- Add the installed ESX vehicle-key integration when required.
- Start
lck-dealershipafter all required dependencies.
ensure oxmysql
ensure ox_lib
ensure qb-core # or es_extended
ensure ox_target
ensure lck-dealership
Requirements
- FiveM with Lua 5.4
ox_libox_targetoxmysqlqb-coreores_extended
Multiple dealerships, searchable catalogs, in-world previews, timed test drives, cash and bank purchases, financing, finite stock, unique plates, purchase history, and responsive keyboard-accessible UI states are included.
Framework
Config.Framework accepts auto, qb, or esx. Auto mode checks the resources listed in Config.AutoFrameworkPriority and uses the first started framework.
The default ownership mappings support common QB-Core and ESX Legacy schemas. If your vehicle table differs, update Config.Database.qb or Config.Database.esx before starting the resource.
Adding a dealership
Copy the premium_deluxe block inside Config.Dealerships and give it a unique key. Each store requires:
- A local employee ped with an
ox_targetinteraction - A local preview vehicle position and scripted camera position
- A delivery bay
- A test-drive spawn and return point
- Categories and vehicles
Vehicle IDs must be unique inside their dealership. The model must be a valid GTA or streamed add-on vehicle model. Prices and stock are always read from the server configuration.
Opening from another resource
exports['lck-dealership']:OpenDealership('premium_deluxe')
-- Or:
TriggerEvent('lck-dealership:client:open', 'premium_deluxe')
These entry points open the configured dealership only; server distance and purchase validation still apply.
stock = -1 creates unlimited stock. Any value of zero or greater is stored in lck_dealership_stock. Changing configured stock later does not overwrite live database stock; update that row manually when intentionally resetting inventory.
In-game catalog management
Config.Management.enabled controls the staff Add Vehicle page. Config.Management.adminGroup defaults to admin. ESX compares it with xPlayer.getGroup(), while QB calls QBCore.Functions.HasPermission(source, adminGroup). The dealership resource does not perform its own ACE check.
The default limits are 100000000 for price and 10000 for finite stock. Vehicle IDs and models may contain letters, numbers, underscores, and hyphens. The client verifies that the spawn model exists and is a vehicle; the server independently validates permissions, dealership proximity, category, price, stock, seats, and display statistics. Added entries are stored in lck_dealership_vehicles.
Employee ped definition
Each dealership needs a local ped definition:
ped = {
model = 's_m_m_autoshop_02',
coords = vector4(-56.79, -1096.65, 25.42, 27.0),
scenario = 'WORLD_HUMAN_CLIPBOARD'
}
The ped is local, frozen, invincible, and cleaned up when the resource stops. ox_target is attached directly to the ped rather than to a sphere zone.
Static vehicle definition
{
id = 'sultan',
model = 'sultan',
label = 'Karin Sultan',
category = 'sports',
price = 72000,
stock = 4,
seats = 4,
speed = 84,
acceleration = 78,
braking = 66,
traction = 82
}
Framework administrators can also publish a valid GTA or add-on spawn model from the in-game Add Vehicle page. Runtime entries are stored in lck_dealership_vehicles and restored after restart.
Financing
Config.Finance controls the bank account, interest, allowed down-payment percentages, allowed terms, payment interval, collection frequency, and missed-payment threshold.
Config.Finance = {
enabled = true,
account = 'bank',
interestPercent = 8,
downPaymentOptions = { 20, 30, 40, 50 },
termOptions = { 6, 12, 18, 24 },
defaultDownPaymentPercent = 20,
defaultTerm = 12,
paymentIntervalHours = 24,
checkIntervalMinutes = 5,
automaticPayments = true,
maxMissedPayments = 3
}
The down payment is charged at purchase. Interest is applied once to the financed balance, which is divided across the selected number of installments. Due installments are collected while the buyer is online; buyers can also pay early from the Purchases page.
After the configured number of missed attempts, a contract is marked delinquent, but the vehicle is not automatically deleted or repossessed.
Ownership tables
player_vehicles
Inserts the license, citizen ID, model, hash, properties, plate, default garage, and stored state.
owned_vehicles
Inserts the owner, plate, serialized properties, vehicle type, and stored state.
Configure the QB default garage with:
Config.Database.qb.defaultGarage = 'pillboxgarage'
Vehicle keys
QB uses qb-vehiclekeys automatically when that resource is started. ESX servers use many different key resources. Add the installed resource event or export in bridge/client/esx.lua inside GiveVehicleKeys.
Server-authoritative purchases
The interface never supplies a trusted price, model, stock value, plate, or vehicle properties. Every purchase validates the player, dealership and vehicle IDs, accepted account, distance, configured price, live balance, finite stock, generated plate, and ownership insert on the server.
Finite stock is reserved with a conditional database update before money is removed.
If payment, finance creation, or ownership persistence fails, stock is restored and the player is refunded.
Sale logging happens after ownership succeeds and cannot invalidate an already-issued vehicle.
The Add Vehicle page is available to ESX players in the configured admin group and QB players accepted by QBCore.Functions.HasPermission. No dealership-specific ACE permission is required.
Themes
The dealership inherits the same named palette approach as LCK Bossmenu. Select a preset with:
Config.UI.theme = 'yellow_black'
A custom theme requires at least six-digit primary and secondary hex colors. Optional semantic surface and text tokens can be copied from the default theme.
Configuration support is available.
Join the LCKSCRIPTS Discord for installation help, integration questions, and product updates.
Join Discord ↗