NullSect
Systems nominal

Docs / Rent a Car / Configuration

Configuration — ns-rentacar

All options live in config.lua (stays editable under escrow). Locales: locales/en.lua, locales/tr.lua.

General

OptionDefaultDescription
Config.Framework'auto''auto', 'qbox', 'qbcore', 'esx', 'standalone'
Config.Locale'en'Active language; missing keys fall back to Config.FallbackLocale
Config.DebugfalseDebug console output (Config.DebugCategories = { rental = true } filters)
Config.UseOxLib / UseOxTargettrueUse ox_lib / ox_target when they are started
Config.Database.autoMigratetrueCreate / update tables on start
Config.Security.*see fileRPC 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-opEconomy / 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.urldocs.fivem.netCatalog picture, %s = model. A vehicle's own image overrides it
Config.Editor.range10.0A new position must be this close to the admin (it is the admin's own spot)
Config.Editor.maxSpawns10Parking spaces per agency
Config.Editor.ghostVehicle'blista'Preview car while placing a parking space on foot

Features (Config.Features)

KeyDefaultOff means
Rentalstruecounters only take returns
DamageChargetruethe full deposit comes back whatever the damage
LateFeestrueno late fee
Repossessiontruean overdue car is never taken back
ReturnAnywheretruethe car must go back to the agency it came from
Imagestruesilhouettes instead of pictures

Rental rules (Config.Rental)

OptionDefaultDescription
accounts{ 'bank', 'cash' }Payment accounts offered; the refund goes back to the same account
durations{ 30, 60, 120 }Rental lengths in real minutes
lateGraceMinutes / lateFeePerMinute2 / 10Free late minutes, then this much per minute (never above the deposit)
repossessAfterMinutes30Minutes after the end until the car is taken back (deposit kept)
damageTolerance50Lost health (of 1000) that is free; the rest is charged in proportion
reconnectMinutes10How long the car waits after a disconnect; 0 ends the rental at once
returnRadius20.0Size of the return lot around returnPoint
warnMinutesLeft5Reminder before the end
warpIntoVehicletrueSeat the renter in the fresh car
spawnClearRadius / spawnTimeout3.0 / 5Free space check, seconds to wait for the car
watchdogSeconds20How often a rental checks its car and its time
platePrefix'RENT'Plate = prefix + 4 digits
ped, blip, vehicleBlip, lotMarkersee fileCounter 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

CommandEffect
/rentalend <player id>ends the player's rental, deletes the car, refunds the full deposit
/rentaleditagency 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).

Cart

Your cart is empty.