Uber App: Installation
Get the Uber style ride hailing app for lb-phone 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 and notification resource on its own and creates its database tables on the first start.
Requirements
| Resource | Required | Notes |
|---|---|---|
| lb-phone | Yes | The app is added to the phone as a custom app |
| ox_lib | Yes | Callbacks and locales |
| oxmysql | Yes | Profiles, trips, wallets and reviews are stored in SQL |
| qbx_core / qb-core / es_extended | Yes | One of them, picked automatically |
| ox_lib / okokNotify / ps-ui | Optional | In-game notifications, see Notifications in the config |
Driver photos are taken with the lb-phone camera or picked from its gallery, so lb-phone's media upload must be set up.
See Dependencies for download links and the start order.
Setup
Download the resource
Get the latest version from portal.cfx.re. See Download your purchase.
Keep the folder name
Keep the folder named hype-uber-app. Every export is called through this name.
Database
Nothing to do in most cases. On every start the script runs sql/install.sql and creates its tables if they do not
exist yet:
| Table | Content |
|---|---|
uber_profiles | Rider and driver profiles |
uber_trips | Every trip with route, fare and status |
uber_trip_events | Status changes of each trip |
uber_wallets | Driver balances and totals |
uber_transactions | Every fare, tip, refund and withdrawal |
uber_reviews | Ratings, comments and tips |
If the console prints Could not create the database tables, your database user may lack the CREATE permission.
Run sql/install.sql by hand once. MySQL 5.7+ or MariaDB 10.2+ is required.
Start the resource
Add it to server.cfg after oxmysql, ox_lib, your framework and lb-phone.
ensure oxmysql
ensure ox_lib
ensure qbx_core # or qb-core / es_extended
ensure lb-phone
# HypeScripts
ensure hype-uber-appSet the basics
Open config/config.lua and check at least App, BaseFare, PricePerMeter, Payment and Wallet.
See Configuration for every option.
Start order matters
If hype-uber-app starts before your framework, the console prints No supported framework found and nothing works.
If lb-phone restarts later, the app is added to the phone again on its own.
Verify
Set Debug = true in the config and start the server. Look for these lines in the console:
[DEBUG:SERVER] [INFO] Framework detected: qbx_core
[DEBUG:SERVER] [SUCCESS] Database tables are ready
[DEBUG:SERVER] [SUCCESS] hype-uber-app is ready (qbx_core)
[DEBUG:CLIENT] [SUCCESS] lb-phone app added (hype-uber)Open the phone. Install the app from the App Store (or find it on the home screen with App.defaultApp = true).
Sign up as a driver on one character and go online. On a second character, sign up as a rider, pick a destination on the map and send a request. The driver gets a notification and can accept it.
Drive to the rider, enter the 4 digit code they see, drive to the destination and finish the ride. The fare shows up in
the driver's wallet. When everything works, set Debug = false again.
How it works
- Sign up: players choose to ride or to drive. The other role can be added later from the profile.
- Request: the rider picks a destination on the map. The fare is calculated from the real road distance, and the rider can offer more than the minimum.
- Accept: online drivers see open requests with the offer and the distance. Accepting sets the GPS to the pickup.
- Start code: when the car is at the pickup, the rider taps My ride is here. A 4 digit code appears, and the rider tells it to the driver. The ride starts only with the right code, and the fare is charged at that moment.
- Finish: near the destination, the driver finishes the ride. The server checks the route and pays the fare into the driver's wallet.
- Review: the rider rates the driver and can leave a comment and a tip.
Trip statuses
| Status | Meaning |
|---|---|
requested | Waiting for a driver |
accepted | A driver accepted the request |
driver_arriving | The driver is on the way to the pickup |
arrived | The driver is at the pickup |
in_progress | The code was entered, the ride is on |
completed | The ride is finished and the fare is paid |
cancelled | Cancelled by the rider, the driver or the system |
expired | No driver accepted it in time |