Exports
Chow Drop exports
Chow Drop exposes a small public API for other resources. Resource name: bs_chowdrop.
Always wait until the resource is started before calling exports.
while GetResourceState('bs_chowdrop') ~= 'started' doWait(100)end
Server exports
GetDriverData(citizenid)
Returns the driver’s database row, or nil if none exists.
local driver = exports['bs_chowdrop']:GetDriverData(citizenid)if driver thenprint(driver.name, driver.level, driver.rating, driver.total_deliveries)end
| Field | Type | Notes |
|---|---|---|
id | number | Internal driver id |
citizenid | string | QBX/QB citizenid, or ESX identifier |
name | string | Character name |
xp | number | |
level | number | |
rating | number | |
total_deliveries | number | |
total_earnings | number | |
pending_earnings | number | |
is_fired | 0/1 | Deactivated for low rating |
last_delivery | timestamp/nil | |
cooldown_until | timestamp/nil | After cancel |
GetOnlineDrivers()
Returns a table of drivers currently online in the app (keyed by server id).
local online = exports['bs_chowdrop']:GetOnlineDrivers()for src, data in pairs(online) doprint(src, data.citizenid, data.name, data.level)end
Each entry:
| Field | Type |
|---|---|
citizenid | string |
driverId | number |
name | string |
level | number |
Empty / missing key = that player is not online for deliveries.
GetLeaderboard()
Returns the cached leaderboard array (same data used by the app).
local board = exports['bs_chowdrop']:GetLeaderboard()for _, entry in ipairs(board) doprint(entry.rank, entry.name, entry.deliveries, entry.earnings, entry.rating, entry.level)end
| Field | Type |
|---|---|
rank | number |
name | string |
deliveries | number |
earnings | number |
rating | number |
level | number |
Refresh interval is controlled by Config.Leaderboard.RefreshInterval.
ResetDriver(citizenid)
Resets a fired (or existing) driver account: clears fired flag, rating back to 5.0, XP/level to defaults, deletes rating history.
local ok = exports['bs_chowdrop']:ResetDriver(citizenid)-- true if a driver row existed and was reset; false if no account
Same behavior as the admin reset command.
Client exports
Call these from client scripts only (local player).
IsDriverOnline()
local online = exports['bs_chowdrop']:IsDriverOnline()-- true if this client toggled "Go Online" in the app
IsOnDelivery()
if exports['bs_chowdrop']:IsOnDelivery() then-- player has at least one active deliveryend
Preferred way to check if the local player is mid-delivery (supports multiple concurrent orders).
GetDeliveryTimeRemaining(orderId?)
Seconds remaining on the delivery timer. Pass an order id, or omit to use the first active order. Returns 0 if none.
local seconds = exports['bs_chowdrop']:GetDeliveryTimeRemaining()local secondsFor = exports['bs_chowdrop']:GetDeliveryTimeRemaining(orderId)
GetActiveOrder()
Intended to return the local player’s active order object (or nil).
local order = exports['bs_chowdrop']:GetActiveOrder()
For “am I delivering?” logic, use IsOnDelivery() instead — the resource tracks multiple orders internally.
Example integrations
Block another job while delivering
-- clientif exports['bs_chowdrop']:IsOnDelivery() thenlib.notify({ description = 'Finish your Chow Drop delivery first.', type = 'error' })returnend
Server: require min driver level
-- serverlocal citizenid = -- your framework id for sourcelocal driver = exports['bs_chowdrop']:GetDriverData(citizenid)if not driver or driver.level < 3 or driver.is_fired == 1 thenreturnend
Server: count online drivers
local n = 0for _ in pairs(exports['bs_chowdrop']:GetOnlineDrivers()) don = n + 1end
Notes
- Identifier: Always pass the same id Chow Drop stores (
citizenid/ ESXidentifier). Wrong id →GetDriverData/ResetDriverreturn nil/false. - No other public exports — order create, staff, payment, and admin flows are internal (
lib.callback/ NUI), not third-party exports. - Do not rely on undocumented net events as a stable API; they can change with updates.
- Ensure
bs_chowdropis in your resource dependencies (or start order) if another script calls these at boot.