Config
Config the resource as you wish
Framework
Set your framework in the config/``shared.lua
framework = 'qbx', -- qbx, qb, esx, oxLocales
Set your language in the shared.lua
Add your own Language file in Locales and set it in the config, the resource supports English only by default
locale = 'en', -- en, fr ... add your own in locales folderUi settings
config/shared.lua
uiStyle = {
allowUserCustomization = false, -- allow the user to customize the ui style in the settings
defaultLayout = 'horizontal', -- horizontal, vertical
defaultAccentColor = '#F0592A',
},Categories
categorieList = {
--- classes from fivem https://docs.fivem.net/natives/?_0x29439776AAA00A62
--- you can add more clases custom ones like 'mynewclass'
'Compacts',
'Sedans',
'SUVs',
'Coupes',
'Muscle',
'Sports Classics',
'Sports',
'Super',
'Motorcycles',
'Off-road',
'Industrial',
'Utility',
'Vans',
'Cycles',
'Boats',
'Helicopters',
'Planes',
'Mynewclass',
'Mynewclass2',
},Vehicle Blacklisting
blackListedVehicles = { -- Vehicles that are not allowed to be sold in the shops
'police',
'ambulance',
'firetruk',
'taxi',
'towtruck',
'burrito3',
'riot',
'riot2',
'armytrailer',
'cutter',
'bulldozer',
--- ADD ANY OTHER VEHICLES YOU WANT TO BLACKLIST HERE
},Other config
management = {
-- Percentage reduction for vehicle import in the shops (50% off) so when the shop owner/manager tries to import a vehicle he will pay only the reduced price
reductionPercentage = 50,
-- Enable or disable the ability for shop owners to edit vehicle prices in the shop, this is used to allow shop owners to set their own prices for vehicles in the shop, if false will use the price in config
enablePriceEdits = true,
-- Maximum allowed profit for the shop owner when reselling vehicles, this is used to prevent shop owners from selling vehicles for too high prices
-- So by example if a vehicle costs 10000 and the maxAllowedProfit is set to 100000, the shop owner can sell it for a maximum of 110000
-- this is used only if enablePriceEdits is set to true
maxAllowedProfit = 100000,
maxDisplaySpots = 5, --- Maximum number of desplay vehicles the manager can set in the shop
-- Default commission percentage paid to employees on direct sales (per-employee override in management)
defaultDirectSaleCut = 10,
},
--- Employee-initiated sales to nearby players (direct sale desk).
directSale = {
nearbyRadius = 8.0, -- scan radius around the employee for target players
maxTargetDistance = 10.0, -- max distance between employee and target when sending
requestTimeoutSecs = 120, -- purchase request expiry
interestRate = 20, -- % added to financed direct sales (matches NUI default)
},
--- Controls how a purchased vehicle reaches the buyer. The buyer chooses a method in the purchase modal.
--- @option 'drive' -> vehicle spawns at the shop's buySpawnsLocation and the player is warped in (the original behaviour)
--- @option 'garage' -> vehicle is sent straight to a garage (not spawned); retrievable from the player's garage
delivery = {
methods = { 'drive', 'garage' }, -- options shown in the purchase modal
default = 'drive', -- pre-selected option
garage = 'pillboxgarage', -- garage name used when delivery method is 'garage'
},Dealership Management
permissions = {
owner = {
canAccessManagement = true, --- can access the management menu
canEditPrices = true, --- can change vehicles prices in stock
canEditStock = true, --- can change vehicles stock (import)
canEditEmployees = true, --- can change employees grades and fire/recruit new ones
canEditGrades = true, --- can change employees grades
canEditDisplaySpots = true, --- can change the display vehicles in the shop
canManageCoupons = true, --- can manage coupons (create/edit/delete)
canAccessToBank = true, --- can access the bank account of the shop (just the acceess no withdraw/deposit or anything else)
canWithdrawFromBank = true, --- can withdraw from the bank account of the shop
canDepositToBank = true, --- can deposit to the bank account of the shop
},
manager = {
canAccessManagement = true,
canEditPrices = true,
canEditStock = true,
canEditEmployees = true,
canEditGrades = true,
canEditDisplaySpots = true,
canManageCoupons = true,
canAccessToBank = true,
canWithdrawFromBank = false,
canDepositToBank = false,
},
sales = {
canAccessManagement = false,
canEditPrices = false,
canEditStock = false,
canEditEmployees = false,
canEditGrades = false,
canEditDisplaySpots = false,
canManageCoupons = false,
canAccessToBank = false,
canWithdrawFromBank = false,
canDepositToBank = false,
},
},Dealership Stock Delivery
--- set how the stock is added to the owned shops when a manager orders/imports vehicles
stockDelivery = {
--- @option 'instant' is selected, the stock will be added instantly to the shop
--- @option 'timeout' is selected, the stock will be added after the timeout ends
--- @option 'delivery' is selected, the stock will be added after the delivery truck reaches the unload point
type = 'instant', -- instant, timeout, delivery
timeout = 60, -- timeout in minutes before the stock is added to the shop (used only when type is set to timeout)
delivery = {
spawnLocation = vec4(-30.0, -1090.0, 26.4, 250.0), -- where the delivery trailer spawns when an order is placed
truckModel = 'phantom', -- model of the delivery truck
trailerModel = 'tr4', -- model of the delivery trailer
},
},TestDrive
tesDrive = {
enabled = true, -- enable or disable test drives
maxTestDriveTime = 30, -- max time in minutes for a test drive
testDriveIncreaseStep = 2, --- (this a ui thing where you can increase the time of the test drive by 5min so by example you set the max to 30 the player can increase from the ui by 5 so it will be 5 --> 10 ...)
--- @option 'return' is selected, the vehicle will be returned to the shop, and the player will be teleported to the return location.
--- @option 'delete' is selected, the vehicle will be deleted, and the player not be teleported anywhere.
onTimeEnd = 'return', -- Action to take when the test drive time ends, can be 'delete' or 'return'
uniqueRoutingBucket = false, -- if true, the player will have a unique routing bucket for the test drive
},License Check
licenseCheck = {
---- by default it works for qbox, qb, esx, ox if you have a different license check system then add your own code in the framework folder
enabled = false, -- gate buy + test drive behind a licence
type = 'driver', -- licence metadata key to require (on ox_core this is a name from the `ox_licenses` table)
},Vehicle list import
---@option 'core' is selected, the vehciles will be imported from the core
---@option 'config' is selected, the vehicles will be imported from the config (config/vehicles.lua)
importType = 'core', -- Type of import system to use, can be 'core' or 'config' (core only works for qbx, qbcore and ox framework)Dealership Config
Example config for a dealership that goes into config/shops.lua This can be done manually or by using the ingame dealership creator tool
pdm = { -- shop unique id
enabled = true, -- Enable or disable the shop
name = 'Premium Deluxe Motorsport', -- Shop name
type = 'owned', -- Type of shop, can be 'owned' or 'selfservice'
zone = { -- Shop zone
shape = {
vec3(-16.06, -1120.61, 26.18),
vec3(-3.56, -1081.18, 25.67),
vec3(-19.5, -1075.21, 25.68),
vec3(-53.26, -1071.62, 26.19),
vec3(-66.31, -1079.87, 25.91),
vec3(-79.63, -1119.16, 24.8),
vec3(-68.87, -1128.63, 24.77),
},
height = 20,
},
showroomlocation = vec3(-57.15, -1097.3, 26.42), -- Location where players can interact with the shop
blip = { -- Map blip for the shop (defaults come from config/client `blip`)
label = 'Premium Deluxe Motorsport',
coords = vec3(-45.67, -1098.34, 26.42), -- leave at vec3(0.0, 0.0, 0.0) to use showroomlocation
show = true, -- set to false to hide the blip for this shop
sprite = 326,
color = 3,
-- scale = 0.8, -- optional, overrides the config/client default
-- display = 4, -- optional, 4 = main map + minimap
-- shortRange = true,-- optional, only show on the minimap when nearby
},
categories = { --- Vehicle categories for the shop
--'utility',
'vans',
'sports',
'oneofone'
},
testDrive = {
enabled = true, -- Enable or disable test drive for this shop
spawnLocation = vec4(-26.13, -1083.29, 25.0, 262.66), -- Location where the test drive vehicle will spawn and returned
},
buySpawnsLocation = {
vec4(-61.35, -1110.31, 25.86, 71.01),
vec4(-59.61, -1104.74, 25.85, 70.13),
vec4(-52.96, -1113.49, 25.87, 71.53),
vec4(-52.34, -1107.93, 25.87, 71.63),
vec4(-44.27, -1116.36, 25.87, 71.7),
vec4(-41.75, -1111.49, 25.87, 71.5),
},
vehiclePreviewLocation = vec4(-48.58, -1095.68, 24.50, 304.95), -- Location where the vehicle will be previewed
showroomSpots = 4, --- Number of vehicles that can be showcased in the showroom at the same time, this will determine how many vehicles can be shown in the showroom at the same time and the shop owner can change which vehicles are shown in the showroom from the boss menu
management = {
managementlocation = vec3(-29.82, -1105.14, 26.42), -- Location of the management menu (access is DB permissions, not job rank)
},
directSaleLocation = vec3(-33.78, -1114.11, 26.42), -- Location of the direct sale menu where the employees can sell vehicles to players directly
stockDelivery = {
spawnLocation = vec4(-30.0, -1090.0, 26.4, 250.0), -- where the delivery truck spawns
unloadLocation = vec3(-47.0, -1116.0, 25.9), -- drive the truck here to unload the order into stock
unloadRadius = 6.0, -- how close the truck must be to the unload point
},
},Server Config
---financing config
financingEnabled = true, -- Enable financing system , set to false to disable financing system
financing = {
paymentCycle = 24, -- time in houres before the next payment is due
cron = '* */12 * * *', -- cron schedule for finance payment more info: https://overextended.dev/ox_lib/Modules/Cron/Server#cron-expression {each 12 hours in this case}
defaultInterestRate = 20, -- Interest rate for financed vehicles 10%, 20 = 20%
maxFinancedVehicles = 3, -- Max number of vehicles a player can finance at a time
maxToDividePaymentsOn = 16, -- the max number of payments to divide the financed vehicle into example 12 = 12 payments (the max is how much the player can set in the financing when buying)
maxOverduePayments = 3, -- Max number of overdue payments before vehicle is considered unpaid and status is failed + the unpaidFinancedVehicleAction is triggered, 3 = 3 overdue payments
command = 'finance', -- command to open the finance menu
},
---@option 'delete' Will delete the vehicle Fron the database if unpaid
---@option 'transfer' Will transfer the vehicle to a specified citizen ID if unpaid, set the citizen id in transferUnpaidFinancedVehicle
---@option 'none' Will do nothing if unpaid
unpaidFinancedVehicleAction = 'transfer', -- Action to take when a financed vehicle is unpaid. Options: 'delete', 'transfer', 'none'
transferUnpaidFinancedVehicleTo = 'WWIJUOP9', -- Citizen ID to transfer unpaid financed vehicles too (use the correct value if using esx and also make sure to change this to a correct one when using qbox or qbcore)
logging = {
enabled = false, -- enable or disable logging
type = 'ox_lib', -- discord, ox_lib (Discord is not ment to be used as a logging sysytem) ox_lib is recomended, https://overextended.dev/docs/ox_lib/Logger/Server#liblogger
discord = {
webhook = '', -- webhook url to send the logs to (unly set it if you are using discord as a logging type)
username = 'am-vehshop', -- name the webhook posts under
avatar = '', -- optional image url for the webhook avatar
},
categories = { -- turn individual log categories off without disabling logging entirely
purchase = true, -- showroom purchases and employee direct sales
testdrive = true, -- test drives started and ended
stock = true, -- stock orders and price changes
bank = true, -- shop deposits and withdrawals
management = true, -- employee hire/fire/edit and showroom display changes
admin = true, -- admin menu: dealership creation, edits, zone and location changes
},
},
adminCommand = 'dealershipadmin',
adminPermissions = { 'admin', 'group.admin', 'command' },
zoneCreator = { --- dont touch if you dont know what you are doing
maxDistance = 100.0,
maxPoints = 64,
minHeight = 2.0,
maxHeight = 100.0,
},