Configuration

Kibra SmartPad Configuration

Fetching Players' Email Addresses

This document shows how to call the GetPlayerEmail export from the kibra-smartpad resource in your FiveM scripts. Simply copy and paste the examples below into your server or client scripts.


Server-Side Usage

-- In your other server script:
local playerServerId = source -- or any valid server ID
local email = exports['kibra-smartpad']:GetPlayerEmail(playerServerId)

if email ~= 'notFound' then
    print(('Player %d email: %s'):format(playerServerId, email))
else
    print(('No email configured for player %d'):format(playerServerId))
end

Client-Side Usage

Since the export is exposed to the client without parameters, you can retrieve the local player’s email directly:

-- client.lua
local email = exports['kibra-smartpad']:GetPlayerEmail()
if email ~= 'notFound' then
    print('My email:', email)
else
    print('Email not set')
end

StartMiniGame Usage

Use the StartMiniGame export in any script where you want to trigger the minigame (like a robbery or hacking).


Creating New Mail Records

You can create and send a new mail entry using the CreateNewMail export. For example, register a server command:

  • Receiver (string): The recipient's email address.

  • MailContent (table): A table with subject and message keys.

  • From_Name (string): The display name of the sender.

  • From (string): The sender's email address.

  • Type (number): A numeric identifier for mail type (e.g., 0 for normal mail).

Copy and paste these snippets to integrate email retrieval and creation quickly!

Custom Create Invoice

This export allows you to create and send a bill (invoice) to a player through the in-game tablet.

📌 Parameters

Parameter
Type
Description

identifier

string

The target player's unique ID (Steam or Rockstar license).

dueDate

string

The bill's due date. Must be in the format "YYYY-MM-DD", e.g., "2025-06-29".

products

table

A list of products or services included in the bill. See format below.

status

number

Bill status: 0 for Pending, 1 for Paid.

note

string

Optional note added to the bill, e.g., "Please pay your invoice."

jobName

string

The job of the player creating the bill (e.g., "mechanic" or "police").

Place events, exports or functions that hide and open your border within these functions.

Example Usage

Fetching Players' Email Addresses

This document shows how to call the GetPlayerEmail export from the kibra-smartpad resource in your FiveM scripts. Simply copy and paste the examples below into your server or client scripts.


Server-Side Usage

Client-Side Usage

Since the export is exposed to the client without parameters, you can retrieve the local player’s email directly:

Copy and paste these snippets to integrate email retrieval quickly!

How to Use GiveTablet Function on Server Side

This function allows you to give a unique SmartPad tablet to a player in your FiveM server, with an automatically generated serial number.

Usage

You can trigger this function from a server-side command, admin menu, or any other server script.

Example: Using with a Command

GetPlayerUnpaidInvoices

Description

Retrieves all unpaid invoices for a given player from the kibra-smartpad resource.

Usage

Parameters

  • source (number): The server ID of the player whose unpaid invoices you wish to fetch.

Returns

  • (table): An array of invoice objects. Each object contains:

    • id (number): Invoice identifier.

    • amount (number): Amount due.

    • dueDate (string): Due date in ISO format (YYYY-MM-DD).

    • issuedDate (string): Date the invoice was issued.

    • status (string): Invoice status ("unpaid").

Example

Notes

  • This export must be called from a server-side context.

  • Ensure the kibra-smartpad resource is started before invoking this export.

Last updated