Features

Rental (fx-rentalapp)

The bundled player-to-player vehicle rental app, how it installs into the phone and its main settings.

#What it is

fx-rentalapp is a vehicle rental app. Players list vehicles they own and others rent them by the day. Payment is held until the rental ends. The app has host approval, a deposit with a damage deduction, ratings and reviews, a host panel, favourites, filters and paid featuring.

The app has six tabs:

Tab What it is for
Fleet The company's own vehicles (Config.DefaultListings). Approved at once
Marketplace Players' own listings: search, class, sorting, favourites
My rental The open rental step by step (payment, approval, pickup, return), a countdown, extension, and past rentals
My listings Listing your own vehicle: create, edit, pause, delete, feature, incoming requests, earnings
Offices The rental offices, nearest first, each with a waypoint button
Guide How renting works, the rules and a FAQ. The rules are generated from the config values

How a rental behaves:

  • The rental period starts when the vehicle is picked up, not while waiting for approval.
  • A running rental can be extended by the day at the same daily price plus tax, up to Config.MaxDays in total.
  • The rented vehicle is not the host's real vehicle. A copy of the same model with a temporary plate is created and removed on return or expiry.
  • An unanswered request is cancelled automatically with a full refund. An expired rental is closed automatically.
  • With Config.UsePickupPoints = true, pickup, return and summoning only work at a rental office. The distance is checked on the server.

#Requirements

Resource Required
fx-phone Yes (the app also installs into lb-phone or cylex_phone)
oxmysql Yes
qb-core, qbx_core or es_extended One of them, detected automatically
A vehicle key resource Optional. qb-vehiclekeys by default (Config.VehicleKeysResource)
A society bank Optional: tgiann-bank, qb-banking, qb-management or esx_society
fx-companyapp Optional: writes commission income to the company history

#Installation

cfgensure oxmysql
ensure fx-phone
ensure fx-rentalapp

The tables (rental_listings, rental_bookings, rental_reviews, rental_favorites, rental_held_vehicles) are created on every start if they are missing. The database user needs CREATE rights; without them, import setup/sql/install.sql by hand.

The console prints the detected framework, vehicle table and account on start.

#How it registers into the phone

With Config.Phone.Resource = "auto" the app installs into the running phone. The FX Phone adapter (client/phone/fxphone.lua) calls exports['fx-phone']:AddCustomApp with identifier = Config.AppIdentifier (default rentalapp), the name, description, developer, defaultApp = Config.DefaultApp, category, size, price = Config.AppPrice, a screenshot, ui and icon.

On the server, notifications go through exports['fx-phone']:SendNotification, and payments are written to the phone's bank history with AddTransaction when Config.Phone.BankHistory = true.

To keep the app from starting at all, set ['fx-rentalapp'] = false in Config.BundledApps. See Apps.

#Config highlights

config.lua:

Setting Meaning
Config.Framework auto, qb, qbox, esx or custom (bridge/adapters.lua)
Config.Locale tr or en. Missing keys fall back to English
Config.AppIdentifier, Config.AppName, Config.DefaultApp, Config.AppPrice How the app appears on the phone
Config.Account, Config.Currency Account the renter pays from (bank or cash) and the currency symbol
Config.PlatformFee, Config.TaxRate Platform commission and tax, as fractions of the subtotal
Config.MinDays, Config.MaxDays Rental length limits
Config.MaxActivePerRenter, Config.MaxListingsPerHost Open rentals per player and listings per host
Config.RequireApproval Whether the host must approve a request
Config.DayRealMinutes Real minutes in one rental day
Config.AutoReturnOnExpire, Config.ExpireCheckMinutes Automatic closing of expired rentals
Config.UsePickupPoints, Config.PointRadius, Config.SlotRadius Office-only pickup and return
Config.SpawnPoints, Config.Offices, Config.Blip Parking slots of the office, or a list of several offices, and their map blips. Change them for your map
Config.DepositEnabled, Config.DepositPercent, Config.DepositFlat, Config.DamageDeduct Deposit and damage deduction
Config.CancelFeePercent, Config.PendingExpireMinutes Cancellation fee and how long a request waits for the host
Config.VehicleKeysResource, Config.RemoveKeysEvent Key integration
Config.VehicleClasses, Config.Tags, Config.BlacklistedModels Listing classes, tags and models that cannot be listed
Config.EnableDefaultListings, Config.DefaultListingName, Config.DefaultListings The official vehicle catalogue that is always rentable

config_server.lua is server only. Config.FeeSociety names the account that receives commission and tax; with nil that money leaves the economy.

#Vehicle images

Images are ui/vehicles/<spawn name>.webp. The base game vehicles ship with the resource. A model without an image shows a generic vehicle icon. For an add-on vehicle, add your own .webp with the same naming.

#Notes on garages

  • Money is taken from the renter's personal account. Job and society money is not used.
  • With fx-garages installed, a listed vehicle stays in its owner's garage record.
  • With other garage systems, the vehicle is taken out of the garage while it is listed and backed up in rental_held_vehicles. It is put back when the listing is deleted.

#Exports

Export Side Purpose
GetVersionStatus() Server Result of the update check: { state, current, latest, behind }

The app has no other exports.