Configuration
Configuration
Almost every behaviour of BUPA Rental is controlled from config.lua. This page walks through each group with real snippets.
Core integrations
Config.Framework = 'qbx' -- 'qb' | 'esx' | 'qbx'
Config.VehicleKeys = 'qbx_vehiclekeys'-- qbx_vehiclekeys | qb-vehiclekeys | mk_vehiclekeys
-- | Renewed-Vehiclekeys | qs-vehiclekeys | custom | none
Config.Inventory = 'ox_inventory' -- 'framework' | 'ox_inventory'
Config.Interaction = 'ox_target' -- 'ox_target' | 'qb-target' | 'textui' | 'marker'
Config.Notify = 'ox_lib' -- 'framework' | 'ox_lib'Economy
Config.PaymentType = 'bank' -- 'cash' | 'bank'
Config.Currency = '$'Prices are always recomputed server-side; the client is never trusted with a price.
Duration model & pricing
A vehicle's price is the base cost for one day. The player picks a unit and a quantity, and the server computes round(pricePerDay × unit.mult × qty). Each unit's seconds defines how long the rental lasts.
Config.RentalUnits = {
{ id = 'minute', labelKey = 'unit_minutes', seconds = 60, mult = 0.0015, min = 5, max = 120, step = 5 },
{ id = 'hour', labelKey = 'unit_hours', seconds = 3600, mult = 0.06, min = 1, max = 24, step = 1 },
{ id = 'day', labelKey = 'unit_days', seconds = 86400, mult = 1.0, min = 1, max = 30, step = 1 },
{ id = 'week', labelKey = 'unit_weeks', seconds = 604800, mult = 6.0, min = 1, max = 8, step = 1 },
}
Config.DefaultUnit = 'day'
Config.DefaultRentalDuration = 3
Config.DurationPresets = {
minute = { 15, 30, 60, 120 },
hour = { 2, 4, 8, 12 },
day = { 1, 3, 7, 14 },
week = { 1, 2, 4, 8 },
}Extras, fees & deposit
Config.Insurance = {
enabled = true, labelKey = 'insurance', price = 90, defaultOn = true,
}
Config.ServiceFee = 25 -- flat fee added to every rental
Config.Deposit = 2000 -- refundable hold, returned on drop-off
Config.RefundDepositOnReturn = trueLifecycle
Config.DeleteVehicleOnExpire = true -- despawn the car when time is up
Config.RemoveDatabaseRecordOnExpire= false -- false = move it to the history table
Config.RestoreRentalsOnStart = true -- re-track active rentals after a restart
Config.CleanupExpiredOnStart = true -- settle rentals whose time already passed
Config.MaxActiveRentalsPerPlayer = 2 -- hard cap enforced server-side
Config.CloseUiOnRent = true -- auto-close the NUI after a rentalRental document / contract item
Config.UseRentalDocument = true
Config.RentalDocumentItem = 'rental_contract'
Config.ReissueKeysOnDocumentUse= true -- using the item re-issues keys if still activeVehicle images
Config.EnableCustomImages = true
Config.VehicleImageBaseUrl = '' -- e.g. 'https://cdn.yoursite.com/vehicles/'The UI resolves images in order: the vehicle's image field → a local mapped pack → Config.VehicleImageBaseUrl + <model>.webp → FiveM's official vehicle CDN → a clean drawn silhouette placeholder that never breaks the layout. Stock GTA5 cars get an image automatically; set image only for custom/addon cars not on the CDN.
Plates & fuel
-- %d = digit, %a = uppercase letter; other characters are literal.
Config.PlateFormat = 'BUPA%d%d%a'
Config.PlatePrefix = ''
Config.Fuel = {
resource = 'auto', -- 'auto' | 'LegacyFuel' | 'ox_fuel' | 'ps-fuel' | 'none'
defaultLevel = 100,
}Each rentable vehicle can also carry its own platePrefix (e.g. CMT), which is prepended to the generated plate.
NPC, blip & interaction
Config.Ped = {
enabled = true, model = 's_m_m_autoshop_01',
coords = vector4(1204.6052, -1057.7350, 40.7856, 152.7861),
scenario = 'WORLD_HUMAN_CLIPBOARD', freeze = true, invincible = true, blockEvents = true,
}
Config.Blip = { enabled = true, sprite = 523, color = 3, scale = 0.8, labelKey = 'blip_label' }
Config.Interact = {
icon = 'fas fa-car', labelKey = 'interact_label', distance = 2.5,
key = 38, -- E, for textui / marker
marker = { type = 27, size = vector3(1.6, 1.6, 0.6),
color = { r = 91, g = 108, b = 240, a = 120 }, drawDistance = 12.0 },
}Logging, permissions & debug
Config.Webhook = '' -- Discord webhook for rental logs (blank = off)
Config.WebhookName = 'BUPA Rental'
Config.AdminAce = 'bupa.rental.admin' -- add_ace group.admin bupa.rental.admin allow
Config.EnableDebug = falseCategories
Config.Categories = {
{ id = 'all', labelKey = 'cat_all' },
{ id = 'super', labelKey = 'cat_super' },
{ id = 'sport', labelKey = 'cat_sport' },
{ id = 'suv', labelKey = 'cat_suv' },
{ id = 'sedan', labelKey = 'cat_sedan' },
{ id = 'muscle', labelKey = 'cat_muscle' },
{ id = 'offroad',labelKey = 'cat_offroad' },
}Rentable vehicles
Each entry in Config.Vehicles defines one rentable car. price is the per-day base; duration is the default quantity in Config.DefaultUnit. The remaining fields feed the showcase card.
{
model = 'comet6', label = 'Pfister Comet', category = 'super',
price = 420, duration = 3, image = nil,
maxSpeed = 196, seats = 2, trunk = 90, fuel = 100,
class = 'S1', desc = 'Rear-engine sports coupe', accel = '2.9s',
drivetrain = 'RWD', stock = 3, platePrefix = 'CMT', active = true,
},| Field | Meaning |
|---|---|
model |
Spawn model name |
label |
Display name in the UI |
category |
Must match a Config.Categories id |
price |
Base price per day |
duration |
Default quantity in the default unit |
image |
nil = auto-resolved; or a custom URL |
maxSpeed, seats, trunk, fuel |
Spec numbers shown on the card |
class, desc, accel, drivetrain, stock |
Showcase details |
platePrefix |
Optional plate prefix for this model |
active |
Set false to hide it from the fleet |
The bundled fleet ships nine cars across super, sport, SUV, sedan and muscle categories. Setting active = false removes a car from the catalogue without deleting its entry.
