Rent a Car App: Installation
Add the Rent a Car app to lb-phone so players can rent vehicles from their phone.
Before you start
This is an add-on for Rent a Car. It holds no rental logic of its own: vehicles, prices, offices, the license check and all fees are configured in hype-rentacar. Install and test that first.
Requirements
| Resource | Required | Notes |
|---|---|---|
| hype-rentacar | Yes | All rental logic, prices, offices and the database live here |
| lb-phone | Yes | The app is added to the phone as a custom app |
| ox_lib | Yes | Callbacks and locales |
| qbx_core / qb-core / es_extended | Optional | Only used to refresh the balance live; without one it refreshes when the app is opened |
No database and no items are needed.
See Dependencies for download links and the start order.
Setup
Download the resource
The app is free and open source (MIT). Get it from GitHub, see Free scripts.
Keep the folder name
The folder must be named hype-rentacar-app. Under any other name the script stops itself and prints a
warning. Place it next to hype-rentacar.
Start the resource
Add it to server.cfg after lb-phone and hype-rentacar.
ensure ox_lib
ensure oxmysql
ensure qbx_core # or qb-core / es_extended
ensure lb-phone
# HypeScripts
ensure hype-rentacar
ensure hype-rentacar-appSet the basics
Open config/config.lua of the app and check the App listing. The phone rules (Remote and Respawn) are set in
hype-rentacar. See Configuration for every option.
Start order matters
If the app starts before hype-rentacar, phone requests are rejected until hype-rentacar is running. If lb-phone restarts later, the app is added to the phone again on its own.
Verify
Set Debug = true in the app config and start the server. Look for these lines in the console:
[DEBUG:CLIENT] [INFO] Framework detected: qbx_core
[DEBUG:CLIENT] [SUCCESS] lb-phone app added (hype-rentacar)Open the phone. Install Rent a Car from the App Store (or find it on the home screen with App.defaultApp = true).
Pick a vehicle, a duration and an account, and rent it. Tap Go to Nearest Office on the My Rentals tab, drive
there and talk to the clerk. The pickup window opens, and the vehicle spawns once you confirm. When everything works,
set Debug = false again.
How it works
- Rent: the player browses the catalog, picks a duration and an account and confirms. The total is rent, deposit and the phone service fee. No vehicle spawns yet.
- Pick up: the rental waits as Awaiting pickup. At any office that offers the model, talking to the clerk opens the pickup window. The rental time already runs from the moment of renting.
- Track: My Rentals shows every active rental with its plate, a live countdown and a progress bar. Show Location marks the vehicle on the GPS.
- Bring to me: if a picked up vehicle was removed, Bring to Me spawns it on a free road next to the player for the respawn fee.
- Return: the vehicle is returned at an office as usual, and the deposit is paid back there.
Rental statuses in the app
| Status | Meaning |
|---|---|
| Awaiting pickup | Rented from the phone, waiting at the offices |
| Vehicle out | Picked up, the vehicle is in the world |
| Vehicle missing | Picked up, but the vehicle no longer exists |