Configuration

Page dedicated to how to configure our Billing System

Languages

You can set the language of the script in the configuration file.

  • en: English

  • fr: French

  • pl: Polish

  • de: German

  • es: Spanish

Exports (Server-side)

Category
Export Name
Description

Creation

CreateInvoice

Create an invoice from one player to another

Creation

CreateInvoiceForSociety

Create an invoice addressed to a company/society

Data Retrieval

GetPlayerInvoices

Retrieve all invoices related to a player

Data Retrieval

GetInvoiceById

Fetch a single invoice by ID

Data Retrieval

GetUnpaidInvoicesCount

Count unpaid invoices for a player

Data Retrieval

HasUnpaidInvoices

Quick boolean check for unpaid invoices

Data Retrieval

GetSocietiesList

Get all registered societies

Management

ForcePayInvoice

Force the payment of an invoice (admin only)

Management

CancelInvoice

Cancel an invoice (admin only)

Statistics

GetPlayerStatistics

Get billing statistics for a player

Analytics

AddIncomeToChart

Add an income entry to the analytics chart

1. CreateInvoice

Description: Creates a new invoice from one player to another.

Parameters:

Name
Type
Required
Description

sourcePlayer

number

yes

ID of the player creating the invoice

targetPlayer

number

yes

ID of the player receiving the invoice

items

table

yes

Table of billed items { label, price, quantity }

invoiceType

string

yes

Type of invoice (personal or society)

Returns: boolean — true if successfully created.

Example:

2. CreateInvoiceForSociety

Description: Creates an invoice addressed to a company or registered society.

Parameters:

Name
Type
Required
Description

sourcePlayer

number

yes

ID of the player issuing the invoice

targetSociety

string

yes

Target society name (e.g. police, ambulance)

items

table

yes

Items list { label, price, quantity }

invoiceType

string

no

Defaults to society

Example:

3. GetPlayerInvoices

Description: Retrieves all invoices belonging to a player (personal, society, and sent).

Parameters:

Name
Type
Required
Description

source

number

yes

Player ID

callback

function

yes

Called with invoices table and money balance

Example:

4. GetInvoiceById

Description: Fetches all details of a specific invoice by its unique ID.

Callback Result Example:

Example:

5. GetUnpaidInvoicesCount

Description: Gets the count of unpaid invoices for a player along with summary data.

Example:

6. HasUnpaidInvoices

Description: Lightweight boolean check to quickly verify if a player has outstanding invoices.

Example:

7. GetSocietiesList

Description: Retrieves all available societies from the database.

Callback Example:

8. ForcePayInvoice (Admin Only)

Description: Allows administrators to enforce payment of any invoice.

Example:

9. CancelInvoice (Admin Only)

Description: Cancels a given invoice (admin privilege required).

Example:

10. GetPlayerStatistics

Description: Returns detailed billing statistics (daily, weekly, monthly).

Example:

11. AddIncomeToChart

Description: Adds income data to analytics. This function updates the internal income chart.

Example:

Data Structures

Data Type
Description

invoiceType

personal, society

invoiceStatus

unpaid, paid, request, rejected, canceled

item

{ label, price, quantity }

Other

1. Framework Detection

Detect which framework your server is running to enable integration automatically.

Explanation:

  • The script checks for the presence of common frameworks (es_extended, qb-core, etc.) and enables relevant functionality.

  • You don’t have to manually toggle these unless you use a less common framework.


2. Society Names Mapping

Define friendly display names for your in-game jobs/societies.

Usage: The script uses these names in invoices and UI elements. Make sure keys match your job names.


3. Invoice Amount Limits

Control the invoice value range.

Example:

  • Prevent invoices smaller than 1 unit or larger than 999,999 units.

  • Set these based on your server economy scale.


4. Invoice Cancellation

Allow users to cancel invoices (both sent and received).

Example:

  • Enabling these lets players cancel invoices they created or those sent to them, preventing disputes.


5. Proximity Check for Invoice Creation

Ensure realism by only allowing invoicing nearby players.

Example:

  • If enabled (>0), the biller must be within 5 meters to create an invoice.

  • Helps prevent abuse and adds immersion.


6. Job and Grade Restrictions

Restrict who can create or pay society invoices.

Explanation:

  • Setting viewAndCreate to 0 means all grades in the job can invoice.

  • Increasing numbers require higher job ranks (grades) for specific permissions.

  • analytics = 4 means only higher ranked members can see financial charts.


7. Notification Settings

Control how players get informed about billing events.

Example:

  • Players receive colorful pop-up messages for invoice payments, errors, etc.

  • Notification colors are customizable per message type.


8. Discord Logging Configuration

Send billing events to Discord for audit/logging.

Use case:

  • Administrator can monitor billing events remotely.

  • Set different webhooks for detailed logs (invoice created, paid, canceled).


9. Sound and Hotkey Settings

Enhance user experience with sounds and quick access.

Example:

  • Plays audio feedback on invoice creation and payment.

  • Pressing F7 opens billing UI instantly.

Last updated