Rent a Car AppNewFree

Rent a Car App: Configuration

Every option in the app's config/config.lua, and the phone rules that live in hype-rentacar.

v1.0.0Open sourceFreeQBox · QBCore · ESX

Tip

After editing, restart only the resource with ensure hype-rentacar-app; a full server restart is not needed.

The app has only a few options of its own in config/config.lua. Vehicles, prices, durations, offices, the license check, the phone service fee and the respawn fee are all set in hype-rentacar's config. Distances are in meters.

General

config/config.lua
Debug = false,
Framework = "auto",

Prop

Type

App

How the app appears in lb-phone and its App Store.

config/config.lua
App = {
    identifier = "hype-rentacar",
    name = "Rent a Car",
    description = "Rent a vehicle from your phone and keep track of your rentals.",
    developer = "Los Santos Rent a Car",
    defaultApp = false,
    price = 0,
    size = 42500,
},

Prop

Type

The app icon is web/build/icon.svg (source: web/public/icon.svg). Replace it to use your own.

GPS and respawn

config/config.lua
SetWaypoint = true,
SpawnRadius = 30.0,

Prop

Type

"Bring to Me" looks for a free road node within SpawnRadius. Without one it uses the spot 4 m in front of the player. The point is checked again on the server against Respawn.maxDistance.

Rental rules

The phone specific rules are part of hype-rentacar's config/config.lua:

hype-rentacar/config/config.lua
Respawn = {
    enabled = true,
    remote = true,
    fee = 250,
    maxDistance = 40.0,
},

Remote = {
    enabled = true,
    fee = 100,
    pickupRadius = 15.0,
},
OptionDescription
Remote.enabledAllows renting from the phone
Remote.feeService fee added to phone rentals
Remote.pickupRadiusMax distance to the office when collecting a phone rental
Respawn.enabled / Respawn.remoteAllows respawning lost rentals at all / from the phone
Respawn.feeFee per respawn
Respawn.maxDistanceMax distance between the player and a phone respawn point

The app also takes CompanyName, UI (currency and number format), PaymentAccounts, MaxActiveRentals and the license rule from hype-rentacar. See Rent a Car configuration.

Locales

The language comes from ox_lib, so it is set in server.cfg rather than in the config:

server.cfg
setr ox:locale "en"

en and tr are included. To add a language, copy locales/en.json, translate it, save it with the language code as its name (e.g. de.json) and set ox:locale to that code. The app has its own locale files, so a new vehicle category needs a label under ui.categories here as well as in hype-rentacar.

config.lua
en.json
tr.json
fxmanifest.lua

Building the UI

The app ships prebuilt in web/build. To change it, edit the Vue source in web/ and rebuild:

cd web
pnpm install
pnpm build

pnpm dev opens a browser preview with mock data.

On this page