Bridge
Bridge System Documentation
Complete guide to the Bridge compatibility system for iSanz Labs
Table of Contents
Introduction
Bridge.Core
Bridge.Gangs
Bridge.Inventory
Bridge.Interaction
Bridge.MenuInput
Bridge.Notify
Bridge.Progressbar
Bridge.Dispatch
Bridge.MiniGames
Custom Bridge Systems
Popular System Examples
Troubleshooting
Introduction
The Bridge system is a compatibility layer that allows iSanz Labs to work with different framework systems without code modifications. It automatically adapts to your server's configuration based on Config.Base settings.
How It Works
The Bridge system:
Detects which resources are installed on your server
Routes function calls to the appropriate system based on
Config.BaseProvides a unified API for all systems
Handles system-specific differences automatically
Configuration
All Bridge systems read from Config.Base in shared/config.lua:
Bridge.Core
File: bridge/core.lua
Purpose: Core framework detection and player object retrieval.
Functions
Bridge.GetCore()
Returns the core framework object and framework name.
Returns:
Core(table) - Framework core objectFramework(string) - Framework name ("qb" or "qbx")
Example:
Bridge.GetPlayer(src)
Gets player object by server source ID.
Parameters:
src(number) - Player server source ID
Returns:
Player object or
nil
Example:
Supported Frameworks
QB-Core (
qb-core)QBX-Core (
qbx_core)
Auto-Detection
The Bridge automatically detects which framework is running:
Bridge.Gangs
File: bridge/gangs.lua
Purpose: Gang system integration for gang-based access control.
Functions
Bridge.Gangs.GetPlayerGang()
Gets current player's gang name (client-side).
Returns:
string- Gang name ornil
Example:
Bridge.Gangs.GetServerGang(source)
Gets player's gang name (server-side).
Parameters:
source(number) - Player server source ID
Returns:
string- Gang name or"none"
Example:
Bridge.Gangs.GetPlayerGangData()
Gets full gang data object (client-side).
Returns:
table- Gang data object ornil
Example:
Bridge.Gangs.GetServerGangData(source)
Gets full gang data object (server-side).
Parameters:
source(number) - Player server source ID
Returns:
table- Gang data object ornil
Bridge.Gangs.IsPlayerInGang(source, gangName)
Checks if player is in a specific gang.
Parameters:
source(number) - Player server source IDgangName(string) - Gang name to check
Returns:
boolean-trueif player is in gang
Example:
Bridge.Gangs.GetAllGangs()
Gets list of all gangs in the framework.
Returns:
table- Array of gang objects{key = "gang_key", name = "Gang Name"}
Example:
Bridge.Gangs.SetCustomGangSystem(customSystem)
Sets a custom gang system for non-standard implementations.
Parameters:
customSystem(table) - Custom system with functions:GetPlayerGang()- Client-side gang nameGetServerGang(source)- Server-side gang nameGetPlayerGangData()- Client-side gang dataGetServerGangData(source)- Server-side gang dataGetAllGangs()- All gangs list
Example:
Supported Systems
QB-Core Gangs - Uses
Core.Shared.GangsQBX-Core Gangs - Uses
exports.qbx_core:GetGangs()Custom Systems - Via
SetCustomGangSystem()
Bridge.Inventory
File: bridge/inventory.lua
Purpose: Inventory system integration for item management.
Configuration
Set Config.Base.inventory to your inventory system:
qb-inventoryox_inventoryps-inventoryqs-inventory
Functions
Bridge.Inventory.Search(item)
Searches for item in player inventory (client-side).
Parameters:
item(string) - Item name
Returns:
number- Item count
Example:
Bridge.Inventory.GetItemCount(source, item)
Gets item count from player inventory (server-side).
Parameters:
source(number) - Player server source IDitem(string) - Item name
Returns:
number- Item count
Example:
Bridge.Inventory.AddItem(source, item, quantity, metadata)
Adds item to player inventory (server-side).
Parameters:
source(number) - Player server source IDitem(string) - Item namequantity(number) - Quantity to addmetadata(table, optional) - Item metadata
Example:
Bridge.Inventory.RemoveItem(source, item, quantity, slot)
Removes item from player inventory (server-side).
Parameters:
source(number) - Player server source IDitem(string) - Item namequantity(number) - Quantity to removeslot(number, optional) - Specific slot to remove from
Example:
Bridge.Inventory.GetItemMetadata(source, item, slot)
Gets item metadata from specific slot.
Parameters:
source(number) - Player server source IDitem(string) - Item nameslot(number) - Slot number
Returns:
table- Metadata or empty table
Example:
Bridge.Inventory.UpdateItemMetadata(source, item, slot, metadata)
Updates item metadata in specific slot.
Parameters:
source(number) - Player server source IDitem(string) - Item nameslot(number) - Slot numbermetadata(table) - New metadata
Example:
Bridge.Inventory.OpenStash(stashName, options)
Opens a stash inventory (client-side).
Parameters:
stashName(string) - Stash identifieroptions(table, optional) - Stash options:maxWeight(number) - Maximum weightslots(number) - Number of slots
Example:
Bridge.Inventory.Stash(gang)
Opens lab stash for specific gang (client-side).
Parameters:
gang(string) - Gang name
Example:
Bridge.Inventory.CreateUsableItem(item, callback)
Registers a usable item with callback.
Parameters:
item(string) - Item namecallback(function) - Callback functionfunction(source) end
Example:
System-Specific Implementations
QB-Inventory / PS-Inventory
Uses QB-Core player objects and exports:
OX Inventory
Uses OX Inventory exports:
QS Inventory
Uses QS Inventory exports:
Bridge.Interaction
File: bridge/interaction.lua
Purpose: World interaction system integration (E key interactions, targeting, etc.).
Configuration
Set Config.Base.interact to your interaction system:
interact- Custom interaction system (default)qb-target- QB-Targetox_target- OX Target
Functions
Bridge.Interaction.AddInteraction(data)
Adds an interaction point in the world.
Parameters:
data(table) - Interaction data:id(string) - Unique interaction IDcoords(vector3) - World coordinatesdistance(number, optional) - Detection distance (default: 2.0)interactDst(number, optional) - Interaction distance (default: 1.5)interactionType(string, optional) - Type for sprite (default: 'key')options(table, optional) - Interaction optionsentity(number, optional) - Entity handleignoreLos(boolean, optional) - Ignore line of sight check
Options Format:
Example - Custom System:
Example - QB-Target:
Example - OX Target:
Bridge.Interaction.RemoveInteraction(id)
Removes an interaction point.
Parameters:
id(string) - Interaction ID
Example:
System-Specific Details
Custom Interaction System (interact)
Uses custom sprite rendering and E key detection:
Requires
Config.InteractionsconfigurationUses
DrawInteractionSprite()functionShows sprites based on
interactionTypeSupports entity-based interactions
QB-Target (qb-target)
Converts to QB-Target format:
OX Target (ox_target)
Converts to OX Target format:
Bridge.MenuInput
File: bridge/menu_input.lua
Purpose: Menu and input dialog system integration.
Configuration
Set Config.Base.menu and Config.Base.input:
Menu:
iSanz-menu,qb-menu,ox_libInput:
iSanz-input,qb-input,ox_lib
Functions
Bridge.MenuInput.OpenMenu(menu, menuId)
Opens a menu dialog.
Parameters:
menu(table) - Menu items arraymenuId(string, optional) - Menu ID for tracking
Menu Format:
Example:
Bridge.MenuInput.OpenInput(inputData, inputType, inputContext)
Opens an input dialog.
Parameters:
inputData(table) - Input configurationinputType(string) - Input type identifierinputContext(table, optional) - Context data
Input Format:
Example:
Handling Input Response:
Set callback before opening input:
Bridge.MenuInput.CloseMenu()
Closes the current menu.
Example:
Bridge.MenuInput.CloseInput()
Closes the current input dialog.
Example:
System-Specific Implementations
QB-Menu / QB-Input
Menu:
Input:
OX Lib
Menu:
Input:
iSanz-Menu / iSanz-Input
Uses NUI-based system:
Sends NUI messages
Uses
SetNuiFocus()for focus controlRequires HTML/JS implementation
Bridge.Notify
File: bridge/notify.lua
Purpose: Notification system integration for player messages.
Configuration
Set Config.Base.notify:
qb- QB-Core notificationsox_lib- OX Lib notifications
Functions
Bridge.Notify.Client(text, notifyType, duration)
Sends notification to local player (client-side).
Parameters:
text(string) - Notification messagenotifyType(string, optional) - Type:success,error,primary,info,warningduration(number, optional) - Duration in milliseconds (default: 5000)
Example:
Bridge.Notify.Server(source, text, notifyType, duration)
Sends notification to specific player (server-side).
Parameters:
source(number) - Player server source IDtext(string) - Notification messagenotifyType(string, optional) - Notification typeduration(number, optional) - Duration in milliseconds
Example:
Bridge.Notify.All(text, notifyType, duration)
Sends notification to all players.
Parameters:
text(string) - Notification messagenotifyType(string, optional) - Notification typeduration(number, optional) - Duration in milliseconds
Example:
Notification Types
QB-Core:
success- Green success messageerror- Red error messageprimary- Blue primary messageinfo- Info message
OX Lib:
success- Success messageerror- Error messageinform- Info message (converted fromprimary/info)warning- Warning message
System-Specific Implementations
QB-Core
OX Lib
Bridge.Progressbar
File: bridge/progressbar.lua
Purpose: Progress bar system integration for timed actions.
Configuration
Set Config.Base.progressbar:
qb- QB-Core progressbarox- OX Lib progressbar
Function
StartProgressbar(progressType, callback, cancelCallback, customLabel, customDuration)
Starts a progress bar with animation and props.
Parameters:
progressType(string) - Predefined progress typecallback(function, optional) - Function to call on completioncancelCallback(function, optional) - Function to call on cancellationcustomLabel(string, optional) - Custom label textcustomDuration(number, optional) - Custom duration in milliseconds
Predefined Types:
lab_hack_prep- Lab hack preparation (2 seconds)lab_hack_finish- Lab hack completion (3 seconds)laptop_hack_prep- Laptop hack (2 seconds)deal_items- Item dealing (5 seconds)collect_items- Item collection (3 seconds, with animation)smoke_joint- Smoking joint (3 seconds, with joint prop)water_plant- Watering plant (3.5 seconds, with watering can)fertilize_plant- Fertilizing (3.5 seconds, with fertilizer)harvest_plant- Harvesting (3.5 seconds, with animation)plant_seed- Planting seed (5 seconds, with trowel)craft_baggy- Bagging buds (5 seconds)craft_baggy_seated- Seated bagging (8 seconds)craft_doll- Crafting doll (8 seconds)rolling_joint- Rolling joint (8 seconds)
Example:
Custom Progress Bar:
Progress Bar Configuration
Each progress type has:
name- Internal identifierlabel- Display textduration- Default duration (milliseconds)disableMovement- Disable player movementdisableCarMovement- Disable vehicle movementdisableMouse- Disable mouse inputdisableCombat- Disable combatanim- Animation dictionary and clipprop- Prop model and attachment
Animation Format:
Prop Format:
System-Specific Implementations
QB-Core
OX Lib
Bridge.Dispatch
File: bridge/dispatch.lua
Purpose: Police dispatch system integration for alerts.
Configuration
Configure in Config.Dispatch:
Function
Bridge.Dispatch.PoliceAlert(coords)
Sends police dispatch alert.
Parameters:
coords(vector3) - Alert location coordinates
Example:
Supported Systems
QB-Core (qb)
Project Sloth (ps)
Core Dispatch (cd)
Custom (custom)
No implementation (requires custom code).
Bridge.MiniGames
File: bridge/minigames.lua
Purpose: Minigame system for hacking challenges.
Function
PlayHackGame(type, options)
Plays a hack minigame.
Parameters:
type(string) - Minigame type:digit,minesweeper,customoptions(table, optional) - Minigame options
Returns:
boolean-trueif completed successfully
Example:
Supported Types
Digit (digit)
Uses bl_ui resource:
Minesweeper (minesweeper)
Uses bl_ui resource:
Custom (custom)
Requires custom implementation in bridge/minigames.lua:
Configuration
Set in Config.MiniGames:
Custom Bridge Systems
You can extend the Bridge system for custom implementations:
Custom Gang System
Custom Dispatch System
Modify bridge/dispatch.lua:
Popular System Examples
Example 1: QB-Core + QB-Inventory + QB-Menu
Config:
Usage:
Uses QB-Core player objects
QB-Inventory exports
QB-Menu for menus
QB-Target for interactions
QB-Core notifications and progressbars
Example 2: QB-Core + OX Inventory + OX Lib
Config:
Usage:
QB-Core for framework
OX Inventory for items
OX Lib for menus, inputs, progressbars, notifications
OX Target for interactions
Example 3: QBX-Core + OX Inventory
Config:
Usage:
QBX-Core framework (detected automatically)
Full OX Lib integration
OX Inventory for items
Example 4: Custom Interaction System
Config:
Usage:
Custom sprite-based interactions
Requires
Config.InteractionsconfigurationUses NUI-based menu/input system
Troubleshooting
Bridge System Not Working
Problem: Bridge functions return nil or don't work.
Solutions:
Check resource names match
Config.BaseexactlyEnsure resources are started before iSanz_Labs
Verify resource names in
fxmanifest.luadependenciesCheck server console for Bridge errors
Inventory Functions Not Working
Problem: Items not adding/removing correctly.
Solutions:
Verify
Config.Base.inventorymatches your inventory resource nameCheck item names exist in your inventory database
Ensure inventory resource exports are working
Test inventory exports directly in server console
Interaction System Not Showing
Problem: Interactions don't appear.
Solutions:
Check
Config.Base.interactsettingFor custom system, ensure
Config.Interactionsis configuredVerify interaction coordinates are correct
Check if target system (qb-target/ox_target) is running
Menu/Input Not Opening
Problem: Menus or inputs don't open.
Solutions:
Verify menu/input resource names in
Config.BaseCheck if resources are started
For NUI systems, verify HTML files are loaded
Check browser console (F8) for NUI errors
Notifications Not Showing
Problem: Notifications don't appear.
Solutions:
Check
Config.Base.notifysettingVerify notification resource is running
Test notification exports directly
Check for console errors
Summary
The Bridge system provides a unified API for multiple framework systems:
Bridge.Core - Framework detection and player objects
Bridge.Gangs - Gang system integration
Bridge.Inventory - Item management
Bridge.Interaction - World interactions
Bridge.MenuInput - Menus and inputs
Bridge.Notify - Notifications
Bridge.Progressbar - Progress bars
Bridge.Dispatch - Police alerts
Bridge.MiniGames - Hacking minigames
All systems automatically adapt based on Config.Base settings, providing seamless compatibility across different server setups.
Support
Documentation: This file
Version: v3.0.0-BETA
Last Updated: 2025
Note: Always test Bridge configuration changes on a development server before applying to production. Resource names must match exactly (case-sensitive).
Last updated
Was this helpful?

