πŸ”ŒBridge Overview

What is the Bridge System?

The Bridge System is a framework-agnostic layer that allows the Billing System to work with any FiveM framework. It provides a unified API for all core functions, regardless of which framework you're using.

Supported Frameworks

Out of the box, the bridge supports:

Framework
Status
Auto-Detect

QBox (qbx_core)

βœ… Fully Supported

βœ… Yes

QBCore (qb-core)

βœ… Fully Supported

βœ… Yes

ESX (es_extended)

βœ… Fully Supported

βœ… Yes

Custom

πŸ”§ Easy to Add

βš™οΈ Manual

How It Works

graph LR
    A[Billing System] --> B[Bridge Layer]
    B --> C[QBox]
    B --> D[QBCore]
    B --> E[ESX]
    B --> F[Custom Framework]

The bridge automatically detects your framework and routes all function calls to the correct implementation.

File Structure

Key Features

βœ… Automatic Detection

The bridge automatically detects your framework:

βœ… Manual Override

Force a specific framework if needed:

βœ… Easy to Extend

Adding support for a custom framework is straightforward:

Bridge Functions

Client-Side Functions

Function
Purpose
Returns

GetPlayerData()

Get player data

table

GetPlayerJob()

Get player's job

table

GetPlayerName()

Get character name

string

GetPlayerIdentifier()

Get unique ID

string

HasAllowedJob()

Check if job allowed

boolean

GetNearbyPlayers()

Get nearby players

table

Notify(msg, type)

Show notification

void

Server-Side Functions

Function
Purpose
Returns

GetPlayer(source)

Get player object

table

GetIdentifier(source)

Get player ID

string

GetPlayerNameServer(source)

Get name

string

GetPlayerJobServer(source)

Get job

table

GetPlayerBank(source)

Get bank balance

number

GetPlayerCash(source)

Get cash balance

number

RemoveMoney(source, amount, type)

Remove money

boolean

AddMoney(source, amount, type)

Add money

boolean

GetAllPlayers()

Get all players

table

IsJobBossServer(source, job)

Check if boss

boolean

Quick Start

Using the Bridge

Adding Custom Framework

See the detailed guides:

https://github.com/dollar-src/docs/blob/main/billing/gitbook-custom-framework.mdchevron-right

Critical Functions

⚠️ Money Handling

The money functions are CRITICAL and must be implemented correctly:

triangle-exclamation

Testing Your Bridge

Basic Test

Money Test

  1. Create invoice for $100

  2. Pay with cash

  3. Verify money was removed

  4. Pay with bank

  5. Verify money was removed

Full Test Checklist

Troubleshooting

Framework Not Detected

Money Functions Not Working

  1. Verify player object is valid

  2. Check money type ('cash' or 'bank')

  3. Add debug prints

  4. Check framework documentation

Next Steps

https://github.com/dollar-src/docs/blob/main/billing/gitbook-client-functions.mdchevron-righthttps://github.com/dollar-src/docs/blob/main/billing/gitbook-server-functions.mdchevron-righthttps://github.com/dollar-src/docs/blob/main/billing/gitbook-custom-framework.mdchevron-right

Last updated