Rent a Car: Installation
Get the vehicle rental offices running on your server in a few minutes.
Before you start
Make sure OneSync is enabled and your server artifact is up to date. The script detects your framework, target, notification, vehicle keys, fuel and inventory resources on its own. The database table must be created once by hand.
Requirements
| Resource | Required | Notes |
|---|---|---|
| ox_lib | Yes | Callbacks, points, text UI and locales |
| oxmysql | Yes | Rentals are stored in SQL |
| qbx_core / qb-core / es_extended | Yes | One of them, picked automatically |
| ox_target / qb-target | Optional | Without one, offices use the E text prompt |
| ox_lib / okokNotify / ps-ui | Optional | Notifications, see Notifications in the config |
| Vehicle keys resource | Optional | qbx_vehiclekeys, qb-vehiclekeys, wasabi_carlock, MrNewbVehicleKeys, qs-vehiclekeys or Renewed-Vehiclekeys |
| Fuel resource | Optional | ox_fuel, LegacyFuel, cdn-fuel, ps-fuel or lc_fuel |
| Inventory resource | Optional | Only for the license item check, see License |
| lb-phone + hype-rentacar-app | Optional | Renting from the phone, see Rent a Car App |
See Dependencies for download links and the start order.
Setup
Download the resource
The script is free and open source (MIT). Get it from GitHub, see Free scripts.
Keep the folder name
The folder must be named hype-rentacar. Under any other name the script stops itself and prints a warning,
and the phone app cannot reach its exports.
Database
Run INSTALL/install.sql on your database once. It creates the hype_rentacar_rentals table, which is not created
automatically.
| Column | Content |
|---|---|
citizenid | Character id of the renter, citizenid on QB/QBox, identifier on ESX |
location | Office id, remote for a phone rental that was not collected |
model / label | Rented vehicle |
plate | Rental plate |
hours / discount | Rental duration and the duration discount |
rent_price | Paid rent, including the phone service fee |
deposit / deposit_refund | Paid deposit and the amount paid back |
payment | Account the rental was paid with |
picked_up | 0 while a phone rental waits at the office |
status | active, returned or expired |
rented_at / expires_at / ended_at | Rental times |
Start the resource
Add it to server.cfg after its dependencies.
ensure ox_lib
ensure oxmysql
ensure qbx_core # or qb-core / es_extended
ensure ox_target # or qb-target (optional)
# HypeScripts
ensure hype-rentacarSet the basics
Open config/config.lua and check at least Locations, Vehicles, Durations and License. On ESX set
License.metadata = "drive". See Configuration for every option.
Start order matters
If hype-rentacar starts before your framework, the console prints No supported framework found and nothing works.
Verify
Set Debug = true in the config and start the server. Look for these lines in the console:
[DEBUG:SERVER] [INFO] framework bridge: qbx_core
[DEBUG:SERVER] [INFO] rentacar server loaded: 1 locations, 12 vehicles, 5 durations, license=true (any), remote=true, respawn=true
[DEBUG:SERVER] [INFO] 0 active rentals loaded, 0 expired while the resource was stopped
[DEBUG:SERVER] [INFO] expiry loop started, checking every 30 secondsGo to the Rent a Car blip at Legion Square and talk to the clerk. Pick a vehicle, a duration and an account, then rent it. You are put behind the wheel with the keys and a full tank.
Drive the vehicle back next to the clerk, talk to them again and press Return. The deposit is paid back, minus
damage. When everything works, set Debug = false again.
How it works
- Rent: the player talks to the clerk, picks a vehicle, a duration and the account to pay with. Rent and deposit are charged together, and the vehicle spawns at the first free spawn point of the office.
- Drive: the vehicle gets a unique rental plate (
RENT1234), keys and the configured fuel level. The office shows the rental with a live countdown. - Return: the vehicle is brought back within
returnRadiusof any office. The deposit is paid back, reduced by engine and body damage whenDeposit.damageDeductionis on. - Expire: players are warned
ExpireWarningminutes before the end. When the time is up, the vehicle is deleted and the rental closes. Remaining time carries over through server restarts. - Respawn: if the vehicle disappears while time is left, the player can respawn it at an office for
Respawn.fee. - Phone: with hype-rentacar-app, a rental can be booked from the phone and collected later at any office. Talking to the clerk then opens the pickup window first.
Rental statuses
| Status | Meaning |
|---|---|
active | The rental is running (phone rentals may not be picked up) |
returned | The vehicle was returned at an office |
expired | The time ran out and the vehicle was recovered |