Skip to content

Server Exports

Advanced Bus Job v1.2.0 exposes no stable public server exports.

Its registered events and ox_lib callbacks are internal mission protocol. Do not trigger them from other resources: they expect active shift state, perform anti-exploit validation, and may change without a public API deprecation cycle.

If you need an addon hook (for example shift started/completed, route completed, or driver score changed), request it through LX support so it can be designed as a server-authoritative public event.

Direct export syntax:

local framework = exports['lx-lib']:GetFramework()

LX product resources may instead include the shared wrapper:

-- fxmanifest.lua
shared_script '@lx-lib/init.lua'
dependency 'lx-lib'

Then call the same API as:

local framework = LX.GetFramework()
local framework = exports['lx-lib']:GetFramework()
-- 'qbx' | 'qb' | 'esx' | nil
local inventory = exports['lx-lib']:GetInventory()
-- 'ox_inventory' | 'qb-inventory' | nil
local player = exports['lx-lib']:GetPlayer(source)
local identifier = exports['lx-lib']:GetIdentifier(source)
local characterName = exports['lx-lib']:GetName(source)

GetPlayer returns a normalized LX player table (or nil), not the underlying framework player object:

{
source = number,
identifier = string?,
name = string,
job = {
name = string,
label = string,
grade = number,
gradeLabel = string,
onDuty = boolean,
},
money = {
cash = number,
bank = number,
},
}

Prefer this shape (and the dedicated money/job/item exports below) for portable addons.

local balance = exports['lx-lib']:GetMoney(source, 'cash')
local added = exports['lx-lib']:AddMoney(source, 'bank', 500, 'route-complete')
local removed = exports['lx-lib']:RemoveMoney(source, 'cash', 50, 'ticket-fee')
local canAfford = exports['lx-lib']:HasMoney(source, 'cash', 50)
Export Returns
GetMoney(source, account) number (0 on invalid input)
AddMoney(source, account, amount, reason?) boolean
RemoveMoney(source, account, amount, reason?) boolean
HasMoney(source, account, amount) boolean

Accounts: cash, bank, and money. money is a portable cash alias — it maps to cash on Qbox/QB and remains money on ESX. Amounts must be greater than zero.

local hasTicket = exports['lx-lib']:HasItem(source, 'bus_ticket', 1)
local count = exports['lx-lib']:GetItemCount(source, 'bus_ticket')
local added = exports['lx-lib']:AddItem(source, 'bus_ticket', 1, {
route = 'metro',
})
local removed = exports['lx-lib']:RemoveItem(source, 'bus_ticket', 1, metadata)
Export Returns
HasItem(source, item, count?) boolean
GetItemCount(source, item) number
AddItem(source, item, count, metadata?) boolean
RemoveItem(source, item, count, metadata?) boolean

Inventory operations return safe failure values when no supported inventory is detected.

RemoveItem metadata: ox_inventory forwards it; qb-inventory ignores the metadata argument and removes by item/slot resolution only.

local job = exports['lx-lib']:GetJob(source)
-- { name, label, grade, gradeLabel, onDuty } | nil
local isPolice = exports['lx-lib']:HasJob(source, 'police', 2)
local onDuty = exports['lx-lib']:IsOnDuty(source)

GetJob returns the normalized job table or nil. HasJob optionally enforces a minimum numeric grade. On standard ESX, missing explicit off-duty is normalized as on-duty.

exports['lx-lib']:Notify(source, 'Route complete', 'success', 5000)

Parameters: source, message, optional type, optional duration. The server routes the notification to ox_lib when available and otherwise uses the framework/native fallback.

lx-navigation has no server exports. Route sessions and GTA path-node calculations are client-side. Keep rewards and mission truth on your own server; navigation is presentation/guidance only.