Configuration — ns-rentacar
All options live in config.lua (stays editable under escrow). Locales: locales/en.lua, locales/tr.lua.
General
| Option | Default | Description |
|---|---|---|
Config.Framework | 'auto' | 'auto', 'qbox', 'qbcore', 'esx', 'standalone' |
Config.Locale | 'en' | Active language; missing keys fall back to Config.FallbackLocale |
Config.Debug | false | Debug console output (Config.DebugCategories = { rental = true } filters) |
Config.UseOxLib / UseOxTarget | true | Use ox_lib / ox_target when they are started |
Config.Database.autoMigrate | true | Create / update tables on start |
Config.Security.* | see file | RPC flood bucket, rate limits, dropAfterFlags (0 = never kick) |
Config.Admin.ace | 'ns-rentacar.admin' | ACE for admin commands; useFrameworkAdmin also accepts framework admins |
Config.Notifications.* | 'auto' | Provider, duration, position, custom function |
Config.Target.* | 'auto' | Provider, interaction distance, built-in prompt key |
Config.Standalone.* | no-op | Economy / admin hooks when no framework is used |
Config.VehicleKeys.provider | 'auto' | 'qbx_vehiclekeys', 'qb-vehiclekeys', 'none', 'custom' (custom.give / remove) |
Config.Fuel.provider / level | 'auto' / 100.0 | 'ox_fuel', 'LegacyFuel', 'cdn-fuel', 'ps-fuel', 'native', 'custom' |
Config.Images.url | docs.fivem.net | Catalog picture, %s = model. A vehicle's own image overrides it |
Config.Editor.range | 10.0 | A new position must be this close to the admin (it is the admin's own spot) |
Config.Editor.maxSpawns | 10 | Parking spaces per agency |
Config.Editor.ghostVehicle | 'blista' | Preview car while placing a parking space on foot |
Features (Config.Features)
| Key | Default | Off means |
|---|---|---|
Rentals | true | counters only take returns |
DamageCharge | true | the full deposit comes back whatever the damage |
LateFees | true | no late fee |
Repossession | true | an overdue car is never taken back |
ReturnAnywhere | true | the car must go back to the agency it came from |
Images | true | silhouettes instead of pictures |
Rental rules (Config.Rental)
| Option | Default | Description |
|---|---|---|
accounts | { 'bank', 'cash' } | Payment accounts offered; the refund goes back to the same account |
durations | { 30, 60, 120 } | Rental lengths in real minutes |
lateGraceMinutes / lateFeePerMinute | 2 / 10 | Free late minutes, then this much per minute (never above the deposit) |
repossessAfterMinutes | 30 | Minutes after the end until the car is taken back (deposit kept) |
damageTolerance | 50 | Lost health (of 1000) that is free; the rest is charged in proportion |
reconnectMinutes | 10 | How long the car waits after a disconnect; 0 ends the rental at once |
returnRadius | 20.0 | Size of the return lot around returnPoint |
warnMinutesLeft | 5 | Reminder before the end |
warpIntoVehicle | true | Seat the renter in the fresh car |
spawnClearRadius / spawnTimeout | 3.0 / 5 | Free space check, seconds to wait for the car |
watchdogSeconds | 20 | How often a rental checks its car and its time |
platePrefix | 'RENT' | Plate = prefix + 4 digits |
ped, blip, vehicleBlip, lotMarker | see file | Counter ped model, map blips, return lot marker |
Vehicles and agencies
Config.Categories = { 'economy', 'sedan', 'suv', 'van', 'premium', 'moto' } -- order, label = locale cat_<id>
Config.Vehicles = {
-- price = rent per hour, deposit = refundable, type defaults to 'automobile' ('bike' for motorcycles)
blista = { label = 'Blista', category = 'economy', price = 120, deposit = 500, seats = 4 },
faggio = { label = 'Faggio', category = 'moto', price = 60, deposit = 250, seats = 2, type = 'bike' },
}
Config.Agencies = {
{
id = 'legion', -- unique, never change it while rentals run
label = 'Legion Car Rental',
ped = vector4(109.97, -1088.61, 29.30, 345.64), -- counter ped (player standing position)
spawns = { vector4(111.42, -1081.24, 29.19, 340.0) }, -- parking spaces, more = more renters at once
returnPoint = vector3(111.42, -1081.24, 29.19), -- centre of the return lot
vehicles = { 'blista', 'faggio' }, -- models offered here
},
}
Rent for a length is ceil(price × minutes / 60).
Optional per agency: enabled = false hides it from players.
Everything can be done in config.lua or in game with /rentaledit. In-game changes are stored in
ns_rentacar_points (positions) and ns_rentacar_agencies (name, vehicle list, on / off, agencies created in game)
and replace the config value of that agency (the counter ped, the whole parking space list, the return lot, the
whole vehicle list). "Reset to config" deletes them. Agencies created in game get an id from their name and are
deleted in game; vehicles themselves (price, deposit) are always defined in Config.Vehicles.
Admin
| Command | Effect |
|---|---|
/rentalend <player id> | ends the player's rental, deletes the car, refunds the full deposit |
/rentaledit | agency editor. Locations: counter ped, parking spaces, return lot; Go (teleport), Move (ghost preview, E saves, Backspace / X cancels), add / remove parking spaces. Vehicles: pick the models offered. Settings: name, open / closed, delete (agencies created in game) or reset to config. New agency: created where you stand |
Hooks for other resources
AddEventHandler('ns-rentacar:hook:securityFlag', function(src, reason, detail) end): every suspicious request.- Rented cars carry the entity statebag
nsRental = { rental, owner }(e.g. to keep them out of garages).