Uber AppNew

Uber App: Exports & Events

Send notifications through the Uber App, adapt the framework bridge and hook into player load events.

v1.0.0Escrow protectedQBox · QBCore · ESX

Resource name

Because the resource name contains hyphens, call exports as exports["hype-uber-app"] rather than exports.hype-uber-app.

ExportSidePurpose
SendNotifyClientShows a notification with the configured resource
SendNotifyServerSame, sent to a player from the server
GetModulesBothReturns the script's module table

Client exports

SendNotify

Shows a notification to the local player with the resource set in Notifications (okokNotify, ps-ui or ox_lib). Use it to keep your own messages in the same style as the app's in-game notifications.

client.lua
exports["hype-uber-app"]:SendNotify("LS Rides", "Your ride is on the way.", 5000, "success")

Prop

Type

Server exports

SendNotify

Sends the same notification to a player from the server. Pass -1 to notify everyone.

server.lua
exports["hype-uber-app"]:SendNotify(source, "LS Rides", "Fares are doubled tonight!", 5000, "info")

Prop

Type

Shared exports

GetModules

Returns the module table of the side it is called on. With a name, only that module.

server.lua
local notify = exports["hype-uber-app"]:GetModules("Notify")
notify.SendNotify(source, "LS Rides", "Hello!", 5000, "success")

Prop

Type

Framework bridges

The framework bridges in frameworks/ are not escrow protected. If your economy or character system is customized, you can change how the script reads players and moves money there. Each bridge implements the same functions:

main.lua
FunctionPurpose
GetPlayerIdentifier(playerId)Character id, citizenid on QB/QBox, identifier on ESX
GetCharacterName(playerId)First and last name, used to fill the sign up form
GetPlayerBirthday(playerId)Birth date, used to fill the age
GetPlayerMoney(playerId, type)Balance of "bank" or "cash"
RemovePlayerMoney(playerId, type, amount, reason)Charges fares and tips, returns true on success
AddPlayerMoney(identifier, type, amount, reason)Refunds and withdrawals, also works for offline characters

Keep the return values

The script relies on RemovePlayerMoney and AddPlayerMoney returning true only when the money really moved. Returning true on a failed payment lets players get money for free.

Events

hype-uber-app:server:player-loaded

Binds a character to the app: their profile, online status and active trip are loaded. The bridges trigger it from QBCore:Server:OnPlayerLoaded and esx:playerLoaded. Trigger it yourself if your multicharacter resource loads characters without these events.

server.lua
TriggerEvent('hype-uber-app:server:player-loaded', source)

hype-uber-app:server:player-unloaded

The opposite: run it when a player switches characters without leaving the server. A driver goes offline, and an active trip gets the DisconnectGrace time to reconnect.

server.lua
TriggerEvent('hype-uber-app:server:player-unloaded', source)

Server only

These are local server events. Never trigger them from the client.

On this page