Server Exports

0R SmartPad | Server Export Functions

0R SmartTab — All Exports Reference

Complete reference for every export available in 0r-smarttab, organized by side and category.

-- Usage from any other resource
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.

Parameter
Type
Description

source

number

Player server ID

Returns
Type

is open

boolean


2. GetPlayerByTabletSerial

Find the owner of a tablet by its serial number. The owner must be online.

Parameter
Type
Description

serial

string

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


App Management

3. IsAppEnabled

Check if a specific app is enabled in server/apps.json.

Parameter
Type
Description

appId

string

App ID (e.g. "app-mail", "app-police")

Returns
Type

enabled

boolean


4. GetAppJobRequirements

Get all job-restricted apps and which jobs they require.

Parameters

none

Returns
Type
Description

requirements

table

{ [appId] = { "job1", "job2" } }


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.

Parameter
Type
Description

targetSrc

number

Target player server ID

data

table

Notification payload

Payload fields:

Field
Type
Required
Description

title

string

yes

Title

message

string

yes

Body text

app

string

no

App ID for icon

icon

string

no

Custom icon

duration

number

no

Duration in ms (default 4000)


6. SetAppBadge (Server)

Set a badge counter on an app icon for a player (from server).

Parameter
Type
Description

targetSrc

number

Target player server ID

appId

string

App ID

count

number

Badge number (0 to clear)


Billing

7. GetPlayerInvoiceList

Get the full invoice list for a player (paid + unpaid). Reads from phone_invoices (QBCore/Qbox) or billing (ESX).

Parameter
Type
Description

source

number

Player server ID

Returns
Type

invoices

table | nil

Each invoice object:

Field
Type
Description

id

number/string

Invoice ID

title

string

Label

sender

string

Sender name / society

amount

number

Total (with interest)

baseAmount

number

Original amount

interestAmount

number

Accrued interest

status

string

"unpaid" / "overdue" / "paid"

dueDate

string

Due date

daysOverdue

number

Days past due


8. GetPlayerInvoiceCount

Total number of invoices (paid + unpaid).

Parameter
Type

source

number

Returns
Type

count

number


9. GetPlayerUnpaidInvoiceCount

Number of unpaid + overdue invoices only.

Parameter
Type

source

number

Returns
Type

count

number


10. GetPlayerTotalDebt

Total debt across all unpaid/overdue invoices (interest included).

Parameter
Type

source

number

Returns
Type

totalDebt

number


11. CheckUnpaidBills

Quick boolean check + count for unpaid bills.

Parameter
Type

source

number

Returns
Type
Description

hasUnpaid

boolean

true if any unpaid bills exist

count

number

Number of unpaid bills


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).

Parameter
Type
Description

source

number

Officer / sender server ID

targetId

string

Target citizen ID / identifier

amount

number

Amount (> 0)

reason

string

Invoice label / reason

Returns nothing (async).


MDT / Police

13. IsPlayerOnDuty

Check if a player is currently on duty (job onduty flag).

Parameter
Type

source

number

Returns
Type

onDuty

boolean


14. CheckHasWarrant

Check if a citizen has active warrants in the MDT.

Parameter
Type

citizenid

string

Returns
Type
Description

hasWarrant

boolean

true if warrants exist

count

number

Number of warrants

records

table

Array of warrant rows


Prison

15. SendJail

Send a player to jail. Auto-detects the prison resource (xt-prison, qb-prison, qb-policejob, esx_policejob).

Parameter
Type
Description

source

number

Officer server ID

targetId

string

Target citizen ID / identifier

jailTime

number

Time in months/minutes (> 0)

Returns nothing. Target must be online.


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.

Parameters

none

Returns
Type

isOpen

boolean


17. OpenTabletWithApp

Open the tablet and jump directly to a specific app. The player must have a tablet item in their inventory.

Parameter
Type
Description

appId

string

App ID or action from apps.json

Returns nothing.


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.

Parameter
Type
Description

data

table

Notification payload (same fields as server version)


19. SetAppBadge (Client)

Set a badge counter on an app icon (local player only).

Parameter
Type
Description

appId

string

App ID

count

number

Badge number (0 to clear)


Tablet Lookup (Async)

20. GetPlayerByTabletSerial (Client)

Look up a tablet's owner by serial number. Queries the server asynchronously.

Parameter
Type
Description

serial

string

Tablet serial number

callback

function

function(result) — result is a table

Result table:

Field
Type

source

number | nil

citizenid

string | nil

name

string | nil


Billing (Async)

All client billing exports query the server and return data via callback.

21. GetPlayerInvoiceList (Client)

Parameter
Type

callback

function(list)


22. GetPlayerInvoiceCount (Client)

Parameter
Type

callback

function(count)


23. GetPlayerUnpaidInvoiceCount (Client)

Parameter
Type

callback

function(count)


24. GetPlayerTotalDebt (Client)

Parameter
Type

callback

function(totalDebt)


Utility

25. GetMugShotBase64

Capture a ped's headshot as a texture dictionary string (for NUI/UI display).

Parameter
Type
Description

ped

number

Ped handle

transparent

boolean

Use transparent background

Returns
Type
Description

txd

string

Texture dictionary name ("none" on failure)

Last updated