0R SmartTab — All Exports Reference#
Complete reference for every export available in 0r-smarttab , organized by side and category.
lua Copy
exports['0r-smarttab' ]:ExportName(...)
Table of Contents#
Server-Side Exports
# Export Category 1 IsPlayerTabletOpen Tablet State 2 GetPlayerByTabletSerial Tablet State 3 IsAppEnabled App Management 4 GetAppJobRequirements App Management 5 SendNotification Notifications 6 SetAppBadge Notifications 7 GetPlayerInvoiceList Billing 8 GetPlayerInvoiceCount Billing 9 GetPlayerUnpaidInvoiceCount Billing 10 GetPlayerTotalDebt Billing 11 CheckUnpaidBills Billing 12 CreateInvoice Billing 13 IsPlayerOnDuty MDT / Police 14 CheckHasWarrant MDT / Police 15 SendJail Prison
Client-Side Exports
# Export Category 16 IsTabletOpen Tablet State 17 OpenTabletWithApp Tablet Control 18 SendNotification Notifications 19 SetAppBadge Notifications 20 GetPlayerByTabletSerial Tablet State 21 GetPlayerInvoiceList Billing 22 GetPlayerInvoiceCount Billing 23 GetPlayerUnpaidInvoiceCount Billing 24 GetPlayerTotalDebt Billing 25 GetMugShotBase64 Utility
Server-Side Exports#
All of these run in server scripts only.
Tablet State#
1. IsPlayerTabletOpen#
Check whether a player currently has their tablet open.
lua Copy
local isOpen = exports['0r-smarttab' ]:IsPlayerTabletOpen(source)
Parameter Type Description sourcenumber Player server ID
Returns Type is open boolean
lua Copy
if exports['0r-smarttab' ]:IsPlayerTabletOpen(5 ) then
print ("Player 5 has their tablet open" )
end
2. GetPlayerByTabletSerial#
Find the owner of a tablet by its serial number. The owner must be online .
lua Copy
local source, citizenId, name = exports['0r-smarttab' ]:GetPlayerByTabletSerial(serial)
Parameter Type Description serialstring Tablet serial (e.g. "0R-A1B2C3")
Returns Type Description source number | nil Player server ID citizenId string | nil Owner citizen ID name string | nil Player character name
lua Copy
local src, cid, name = exports['0r-smarttab' ]:GetPlayerByTabletSerial("0R-A1B2C3" )
if src then
print (name .. " owns this tablet (server id: " .. src .. ")" )
end
App Management#
3. IsAppEnabled#
Check if a specific app is enabled in server/apps.json.
lua Copy
local enabled = exports['0r-smarttab' ]:IsAppEnabled(appId)
Parameter Type Description appIdstring App ID (e.g. "app-mail", "app-police")
Returns Type enabled boolean
lua Copy
if exports['0r-smarttab' ]:IsAppEnabled("app-mail" ) then
print ("Mail app is active" )
end
4. GetAppJobRequirements#
Get all job-restricted apps and which jobs they require.
lua Copy
local requirements = exports['0r-smarttab' ]:GetAppJobRequirements()
Returns Type Description requirements table { [appId] = { "job1", "job2" } }
lua Copy
local reqs = exports['0r-smarttab' ]:GetAppJobRequirements()
Notifications#
5. SendNotification (Server)#
Send a notification to a player's tablet from the server. Shows immediately if the tablet is open, otherwise queues as a peek notification.
lua Copy
exports['0r-smarttab' ]:SendNotification(targetSrc, data)
Parameter Type Description targetSrcnumber Target player server ID datatable Notification payload
Payload fields:
Field Type Required Description titlestring yes Title messagestring yes Body text appstring no App ID for icon iconstring no Custom icon durationnumber no Duration in ms (default 4000)
lua Copy
exports['0r-smarttab' ]:SendNotification(source, {
title = "Delivery" ,
message = "New package available for pickup." ,
app = "app-mail" ,
duration = 5000
})
6. SetAppBadge (Server)#
Set a badge counter on an app icon for a player (from server).
lua Copy
exports['0r-smarttab' ]:SetAppBadge(targetSrc, appId, count)
Parameter Type Description targetSrcnumber Target player server ID appIdstring App ID countnumber Badge number (0 to clear)
lua Copy
exports['0r-smarttab' ]:SetAppBadge(source, "app-mail" , 3 )
Billing#
7. GetPlayerInvoiceList#
Get the full invoice list for a player (paid + unpaid). Reads from phone_invoices (QBCore/Qbox) or billing (ESX).
lua Copy
local invoices = exports['0r-smarttab' ]:GetPlayerInvoiceList(source)
Parameter Type Description sourcenumber Player server ID
Returns Type invoices table | nil
Each invoice object:
Field Type Description idnumber/string Invoice ID titlestring Label senderstring Sender name / society amountnumber Total (with interest) baseAmountnumber Original amount interestAmountnumber Accrued interest statusstring "unpaid" / "overdue" / "paid"dueDatestring Due date daysOverduenumber Days past due
lua Copy
local list = exports['0r-smarttab' ]:GetPlayerInvoiceList(source)
if list then
for _, inv in ipairs (list) do
print (inv.title, inv.amount, inv.status )
end
end
8. GetPlayerInvoiceCount#
Total number of invoices (paid + unpaid).
lua Copy
local count = exports['0r-smarttab' ]:GetPlayerInvoiceCount(source)
Parameter Type sourcenumber
9. GetPlayerUnpaidInvoiceCount#
Number of unpaid + overdue invoices only.
lua Copy
local unpaid = exports['0r-smarttab' ]:GetPlayerUnpaidInvoiceCount(source)
Parameter Type sourcenumber
10. GetPlayerTotalDebt#
Total debt across all unpaid/overdue invoices (interest included).
lua Copy
local debt = exports['0r-smarttab' ]:GetPlayerTotalDebt(source)
Parameter Type sourcenumber
Returns Type totalDebt number
11. CheckUnpaidBills#
Quick boolean check + count for unpaid bills.
lua Copy
local hasUnpaid, count = exports['0r-smarttab' ]:CheckUnpaidBills(source)
Parameter Type sourcenumber
Returns Type Description hasUnpaid boolean true if any unpaid bills existcount number Number of unpaid bills
lua Copy
local hasUnpaid, count = exports['0r-smarttab' ]:CheckUnpaidBills(source)
if hasUnpaid then
print ("Player owes " .. count .. " bill(s)" )
end
12. CreateInvoice#
Create a new invoice for a target citizen. Officer info is auto-resolved from source. Supports QBCore/Qbox (phone_invoices) and ESX (billing).
lua Copy
exports['0r-smarttab' ]:CreateInvoice(source, targetId, amount, reason)
Parameter Type Description sourcenumber Officer / sender server ID targetIdstring Target citizen ID / identifier amountnumber Amount (> 0) reasonstring Invoice label / reason
Returns nothing (async).
lua Copy
exports['0r-smarttab' ]:CreateInvoice(source, "ABC12345" , 5000 , "Speeding violation" )
MDT / Police#
13. IsPlayerOnDuty#
Check if a player is currently on duty (job onduty flag).
lua Copy
local onDuty = exports['0r-smarttab' ]:IsPlayerOnDuty(source)
Parameter Type sourcenumber
lua Copy
if exports['0r-smarttab' ]:IsPlayerOnDuty(source) then
print ("Officer is on duty" )
end
14. CheckHasWarrant#
Check if a citizen has active warrants in the MDT.
lua Copy
local hasWarrant, count, records = exports['0r-smarttab' ]:CheckHasWarrant(citizenid)
Parameter Type citizenidstring
Returns Type Description hasWarrant boolean true if warrants existcount number Number of warrants records table Array of warrant rows
lua Copy
local has, count, recs = exports['0r-smarttab' ]:CheckHasWarrant("ABC12345" )
if has then
print (count .. " active warrant(s)" )
end
Prison#
15. SendJail#
Send a player to jail. Auto-detects the prison resource (xt-prison, qb-prison, qb-policejob, esx_policejob).
lua Copy
exports['0r-smarttab' ]:SendJail(source, targetId, jailTime)
Parameter Type Description sourcenumber Officer server ID targetIdstring Target citizen ID / identifier jailTimenumber Time in months/minutes (> 0)
Returns nothing. Target must be online .
lua Copy
exports['0r-smarttab' ]:SendJail(source, "ABC12345" , 30 )
Client-Side Exports#
All of these run in client scripts only and affect the local player.
Tablet State & Control#
16. IsTabletOpen#
Check if the local player's tablet is currently open.
lua Copy
local isOpen = exports['0r-smarttab' ]:IsTabletOpen()
lua Copy
if exports['0r-smarttab' ]:IsTabletOpen() then
print ("My tablet is open" )
end
17. OpenTabletWithApp#
Open the tablet and jump directly to a specific app. The player must have a tablet item in their inventory.
lua Copy
exports['0r-smarttab' ]:OpenTabletWithApp(appId)
Parameter Type Description appIdstring App ID or action from apps.json
Returns nothing.
lua Copy
exports['0r-smarttab' ]:OpenTabletWithApp("app-mail" )
exports['0r-smarttab' ]:OpenTabletWithApp("customapp" )
exports['0r-smarttab' ]:OpenTabletWithApp("settings" )
exports['0r-smarttab' ]:OpenTabletWithApp("app-police" )
Notifications#
18. SendNotification (Client)#
Send a notification to the local player's tablet. If open, appears immediately; if closed, queues and shows a peek animation.
lua Copy
exports['0r-smarttab' ]:SendNotification(data)
Parameter Type Description datatable Notification payload (same fields as server version)
lua Copy
exports['0r-smarttab' ]:SendNotification({
title = "Alert" ,
message = "Something happened nearby." ,
app = "app-police" ,
duration = 4000
})
19. SetAppBadge (Client)#
Set a badge counter on an app icon (local player only).
lua Copy
exports['0r-smarttab' ]:SetAppBadge(appId, count)
Parameter Type Description appIdstring App ID countnumber Badge number (0 to clear)
lua Copy
exports['0r-smarttab' ]:SetAppBadge("app-mail" , 5 )
Tablet Lookup (Async)#
20. GetPlayerByTabletSerial (Client)#
Look up a tablet's owner by serial number. Queries the server asynchronously.
lua Copy
exports['0r-smarttab' ]:GetPlayerByTabletSerial(serial, callback)
Parameter Type Description serialstring Tablet serial number callbackfunction function(result) — result is a table
Result table:
Field Type sourcenumber | nil citizenidstring | nil namestring | nil
lua Copy
exports['0r-smarttab' ]:GetPlayerByTabletSerial("0R-A1B2C3" , function (result)
if result.source then
print (result.name .. " — server id: " .. result.source)
end
end )
Billing (Async)#
All client billing exports query the server and return data via callback.
21. GetPlayerInvoiceList (Client)#
lua Copy
exports['0r-smarttab' ]:GetPlayerInvoiceList(function (list)
for _, inv in ipairs (list) do
print (inv.title, inv.amount, inv.status )
end
end )
Parameter Type callbackfunction(list)
22. GetPlayerInvoiceCount (Client)#
lua Copy
exports['0r-smarttab' ]:GetPlayerInvoiceCount(function (count)
print ("Total invoices: " .. count)
end )
Parameter Type callbackfunction(count)
23. GetPlayerUnpaidInvoiceCount (Client)#
lua Copy
exports['0r-smarttab' ]:GetPlayerUnpaidInvoiceCount(function (count)
print ("Unpaid: " .. count)
end )
Parameter Type callbackfunction(count)
24. GetPlayerTotalDebt (Client)#
lua Copy
exports['0r-smarttab' ]:GetPlayerTotalDebt(function (debt)
print ("Total debt: $" .. debt)
end )
Parameter Type callbackfunction(totalDebt)
Utility#
25. GetMugShotBase64#
Capture a ped's headshot as a texture dictionary string (for NUI/UI display).
lua Copy
local txd = exports['0r-smarttab' ]:GetMugShotBase64(ped, transparent)
Parameter Type Description pednumber Ped handle transparentboolean Use transparent background
Returns Type Description txd string Texture dictionary name ("none" on failure)
lua Copy
local ped = PlayerPedId()
local headshot = exports['0r-smarttab' ]:GetMugShotBase64(ped, true )