Uber AppNew

Uber App: Installation

Get the Uber style ride hailing app for lb-phone running on your server in a few minutes.

v1.0.0Escrow protectedQBox · QBCore · ESX

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

ResourceRequiredNotes
lb-phoneYesThe app is added to the phone as a custom app
ox_libYesCallbacks and locales
oxmysqlYesProfiles, trips, wallets and reviews are stored in SQL
qbx_core / qb-core / es_extendedYesOne of them, picked automatically
ox_lib / okokNotify / ps-uiOptionalIn-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.

fxmanifest.lua

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:

TableContent
uber_profilesRider and driver profiles
uber_tripsEvery trip with route, fare and status
uber_trip_eventsStatus changes of each trip
uber_walletsDriver balances and totals
uber_transactionsEvery fare, tip, refund and withdrawal
uber_reviewsRatings, 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.

server.cfg
ensure oxmysql
ensure ox_lib
ensure qbx_core          # or qb-core / es_extended
ensure lb-phone

# HypeScripts
ensure hype-uber-app

Set 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

StatusMeaning
requestedWaiting for a driver
acceptedA driver accepted the request
driver_arrivingThe driver is on the way to the pickup
arrivedThe driver is at the pickup
in_progressThe code was entered, the ride is on
completedThe ride is finished and the fare is paid
cancelledCancelled by the rider, the driver or the system
expiredNo driver accepted it in time

Next steps

On this page