Client Exports

0R SmartPad | Client Export Functions

0R SmartTab — Client Exports Reference

Complete reference for every client-side export available in 0r-smarttab.

-- Usage from any other client script
exports['0r-smarttab']:ExportName(...)

All exports below run on the client and apply to the local player unless stated otherwise.


Table of Contents

#
Export
Category
Async

1

IsTabletOpen

Tablet State

No

2

OpenTabletWithApp

Tablet Control

No

3

SendNotification

Notifications

No

4

SetAppBadge

Notifications

No

5

GetPlayerByTabletSerial

Tablet Lookup

Yes (callback)

6

GetPlayerInvoiceList

Billing

Yes (callback)

7

GetPlayerInvoiceCount

Billing

Yes (callback)

8

GetPlayerUnpaidInvoiceCount

Billing

Yes (callback)

9

GetPlayerTotalDebt

Billing

Yes (callback)

10

GetMugShotBase64

Utility

Yes (yields)


Tablet State

1. IsTabletOpen

Check if the local player's tablet is currently open.

Parameters

none

Returns
Type
Description

isOpen

boolean

true if the tablet UI is open

Example:


Tablet Control

2. OpenTabletWithApp

Open the tablet and navigate directly to a specific app. The player must have a tablet item in their inventory (and satisfy metadata checks if enabled).

Parameter
Type
Description

appId

string

App id or action from server/apps.json

Returns

nothing

Example:

Tip: You can find valid app IDs in server/apps.json. Each app has an id and/or action field — either one works.


Notifications

3. SendNotification

Push a notification to the local player's tablet. If the tablet is open, it appears immediately as an in-app notification. If the tablet is closed, it queues and plays a peek animation on screen.

Parameter
Type
Description

data

table

Notification payload

Payload fields:

Field
Type
Required
Default
Description

title

string

yes

Notification title

message

string

yes

Body text

app

string

no

nil

App ID — determines the icon shown

icon

string

no

nil

Custom icon override

duration

number

no

4000

How long to show (ms)

type

string

no

nil

Optional type tag

category

string

no

nil

Optional category tag

Returns

nothing

Example:


4. SetAppBadge

Set a numeric badge on an app's home-screen icon. Useful for showing unread counts.

Parameter
Type
Description

appId

string

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

count

number

Badge number — pass 0 to clear

Returns

nothing

Example:


Tablet Lookup

5. GetPlayerByTabletSerial

Find the owner of a tablet by its serial number. Sends a request to the server and returns the result via callback. The owner must be online to be found.

Parameter
Type
Description

serial

string

Tablet serial number (e.g. "0R-A1B2C3")

callback

function

Called with the result table

Callback result:

Field
Type
Description

source

number | nil

Player server ID (nil if offline / not found)

citizenid

string | nil

Owner citizen ID / identifier

name

string | nil

Player character name

Example:


Billing

All billing exports fetch data from the server asynchronously. They return data for the local player only.

6. GetPlayerInvoiceList

Get the full list of invoices (paid + unpaid) for the local player.

Parameter
Type
Description

callback

function

Called with the invoice array

Each invoice object:

Field
Type
Description

id

number / string

Invoice ID

title

string

Invoice label

sender

string

Sender name or society

amount

number

Total amount (with interest if overdue)

baseAmount

number

Original amount before interest

interestAmount

number

Accrued interest (0 if not overdue)

status

string

"unpaid" / "overdue" / "paid"

dueDate

string

Formatted due date

daysOverdue

number

Days past the due date (0 if not overdue)

Example:


7. GetPlayerInvoiceCount

Get the total number of invoices (paid + unpaid).

Parameter
Type

callback

function(count: number)

Example:


8. GetPlayerUnpaidInvoiceCount

Get the number of unpaid and overdue invoices only.

Parameter
Type

callback

function(count: number)

Example:


9. GetPlayerTotalDebt

Get the total debt amount across all unpaid / overdue invoices (interest included).

Parameter
Type

callback

function(totalDebt: number)

Example:


Utility

10. GetMugShotBase64

Capture a ped's headshot and return it as a base64 image string. This is a yielding call — it blocks the current thread until the headshot is ready (up to ~2 seconds).

Parameter
Type
Description

ped

number

Ped entity handle

transparent

boolean

true for transparent background, false for default

Returns
Type
Description

base64

string

Base64-encoded image data (or empty string on failure)

Example:

Note: This function yields (uses Citizen.Await internally). Call it from a CreateThread or async context — do not call it from a synchronous NUI callback handler.


Quick Reference

Export
Returns
Sync?

IsTabletOpen()

boolean

Sync

OpenTabletWithApp(appId)

Sync

SendNotification(data)

Sync

SetAppBadge(appId, count)

Sync

GetPlayerByTabletSerial(serial, cb)

via callback

Async

GetPlayerInvoiceList(cb)

via callback

Async

GetPlayerInvoiceCount(cb)

via callback

Async

GetPlayerUnpaidInvoiceCount(cb)

via callback

Async

GetPlayerTotalDebt(cb)

via callback

Async

GetMugShotBase64(ped, transparent)

string

Yielding

Last updated