Description
๐ RPS_LIB
Universal FiveM Bridge Library
Write your scripts once and run them everywhere.
RPS_LIB provides a universal bridge layer for FiveM, allowing resources to support multiple frameworks and third-party systems without rewriting code.
๐ง Supported Frameworks
| Resource | Framework |
|----------|-----------|
| es_extended | ESX |
| qb-core | QBCore |
| qbx_core | QBX |
| ox_core | Overextended |
| ND_Core | ND Framework |
๐ฆ Supported Modules
Framework
Supports:
- ESX
- QBCore
- QBX Core
- ox_core
- ND_Core
Features
Client
- Get player job
- Get grade
- Get money
- Get identifier
- Job checks
- Raw player data
Server
- Access player data
- Add money
- Remove money
- Get online players
- Get framework object
Inventory
Supports:
- ox_inventory
- qb-inventory
- qs-inventory
- ps-inventory
- codem-inventory
Client
- Item count
- Has item checks
- Inventory list
- Open stash
- Open trunk
- Trigger item use
Server
- Add item
- Remove item
- Count item
- Has item
- Register usable items
- Register stashes
Notifications
Supports:
- ox_lib
- qb-core
- okokNotify
- mythic_notify
- es_extended
- GTA native fallback
Features
- Success
- Error
- Warning
- Info
- Progress bars
- Input dialogs
- Server notifications
- Broadcast notifications
- Job notifications
Fuel
Supports:
- ox_fuel
- LegacyFuel
- cdn-fuel
- ps-fuel
- sna-fuel
- Native fallback
Features
- Get fuel
- Set fuel
- Add fuel
- Remove fuel
- Low fuel checks
- Continuous fuel drain
Radial Menu
Supports:
- ox_lib
- qb-radialmenu
Features
- Add radial entries
- Remove entries
- Add submenus
- Disable radial menu
- Automatic event registration
Dispatch
Supports:
- ps-dispatch
- cd_dispatch
- linden_outlawalert
- core_dispatch
- qs-dispatch
Features
- Custom alerts
- Police alerts
- EMS alerts
- Fire alerts
- Multi-job support
- Server relay fallback
Target
Supports:
- ox_target
- qb-target
- bt-target
Features
- Entity targets
- Box zones
- Sphere zones
- Model targets
- Job restrictions
- Item restrictions
- Automatic callback registration
Door Locks
Supports:
- ox_doorlock
- qb-doorlock
- nUI_doorlock
- Native fallback
Features
- Register doors
- Lock doors
- Unlock doors
- Toggle doors
- Persistent states
- Client synchronization
Gang System
Detection Priority:
op-crime
โ
ps-gangs
โ
op-gangs
โ
esx_gang
โ
qbx_core
โ
qb-core
โ
ND_Core
Features
Client
- Get gang information
- Check boss status
- Gang checks
- Multi-gang support
- Event listeners
- Normalized gang data
Server
- Set gang
- Remove gang
- Get gang members
- Get gang bosses
- Gang notifications
- Refresh events
โ๏ธ Core Systems
Bridge Resolver
Features:
- Lazy resolution
- Automatic detection
- Config pinning
- Hard pin failure warnings
- Result caching
- Module disabling
Module Registry
Every module:
Module{}
Completes with:
Lib.done()
Status:
- loaded
- declared
- disabled
No central registry required.
Event Bus
Available on both:
- Client
- Server
Functions:
Lib.on()
Lib.off()
Lib.emit()
Used internally by:
- Gang updates
- Door states
- Dispatch alerts
Ready Gate
Lib.onReady(function()
end)
Callbacks fire:
- After resource initialization
- Immediately if already ready
Prevents startup race conditions.
Boot Report
Displays:
- Module name
- Active bridge
- Detection mode
- Current status
- Active count
- Disabled count
- Failed count
Status types:
- ACTIVE
- PINNED
- AUTO
- NATIVE
- DISABLED
- NO BRIDGE
๐ค Client Exports
| Export | Description |
|----------|------------|
| GetLib() | Full library |
| GetFramework() | Framework module |
| GetInventory() | Inventory module |
| GetNotify() | Notification module |
| GetFuel() | Fuel module |
| GetRadial() | Radial module |
| GetDispatch() | Dispatch module |
| GetTarget() | Target module |
| GetDoors() | Door module |
| GetGang() | Gang module |
| OnReady(cb) | Ready callback |
| GetBridges() | Resolved bridges |
| GetStatus() | Module status |
๐ค Server Exports
| Export | Description |
|----------|------------|
| GetLib() | Full library |
| GetFramework() | Framework module |
| GetInventory() | Inventory module |
| GetNotify() | Notification module |
| GetDoors() | Door module |
| GetDispatch() | Dispatch module |
| GetGang() | Gang module |
| GetPlayer(src) | Framework player |
| IsJob(src, jobs, grade) | Job check |
| DoTransaction(src, opts) | Atomic transactions |
| GetBridges() | Bridge names |
| GetStatus() | Module status |
๐ Plug-and-Play Modules
Create:
modules/mymodule/
โโโ init.lua
โโโ client.lua
โโโ server.lua
init.lua
Declares:
Module{}
client.lua
Ends with:
Lib.done('mymodule')
server.lua
Ends with:
Lib.done('mymodule')
๐ File Structure
rps_lib
โ
โโโ fxmanifest.lua
โ
โโโ config
โ โโโ config.lua
โ
โโโ core
โ โโโ shared.lua
โ โโโ client.lua
โ โโโ server.lua
โ โโโ exports_client.lua
โ โโโ exports_server.lua
โ
โโโ modules
โโโ _template
โโโ framework
โโโ inventory
โโโ notify
โโโ fuel
โโโ radial
โโโ dispatch
โโโ target
โโโ doorlock
โโโ gang
๐ Quick Start
server.cfg
ensure rps_lib
Place it before your scripts.
fxmanifest.lua
dependencies {
'rps_lib'
}
client.lua
local Lib = exports['rps_lib']:GetLib()
server.lua
local Lib = exports['rps_lib']:GetLib()
๐ Version Information
| Property | Value |
|------------|-------|
| Name | rps_lib |
| Version | 1.0.0 |
| Game | GTA V / FiveM |
| Lua | 5.4 |
| Modules | 9 |
| Total Files | 37 |
| Supported Bridges | 38 |
โค๏ธ Designed For
- ESX
- QBCore
- QBX
- Overextended
- ND Framework
Build your resource once and let RPS_LIB handle the rest.
Features
- **Core**
- - โ Auto-detects running resources on server start
- - โ Pin any module to a specific resource in config
- - โ Disable any module with `false` in config
- - โ Boot report shows every module status on start
- - โ No silent fallback when a pinned resource is not running
- - โ Lazy bridge resolution โ config always read before detection
- - โ Bridge results cached after first call โ zero repeated overhead
- - โ Internal event bus on both client and server
- - โ Client ready gate prevents startup race conditions
- - โ 37 Lua files, all syntax-verified
- **Framework**
- - โ Get player job name, grade, and label
- - โ Get player money by account (cash, bank, black_money)
- - โ Get player citizen identifier
- - โ Check player job with optional minimum grade
- - โ Accept a single job or list of jobs for job checks
- - โ Server: add and remove money with insufficient funds check
- **Inventory**
- - โ Get item count
- - โ Check player has minimum quantity of an item
- - โ Get all inventory items as normalised list
- - โ Open stash and vehicle trunk
- - โ Server: add and remove items with optional metadata
- - โ Server: register usable item callback
- - โ Server: register persistent stash
- **Notifications**
- - โ Success, error, info, and warning notifications
- - โ Progress bar with animation and cancel support
- - โ Input dialog with multiple field types
- - โ Server: send to player, broadcast to all, broadcast to job
- - โ Native GTA fallback if no system found
- **Fuel**
- - โ Get, set, add, and remove fuel
- - โ Low fuel threshold check
- - โ Drain thread with custom rate โ returns a stop function
- - โ Server: set and add fuel by vehicle network id
- - โ Native fallback if no system found
- **Radial Menu**
- - โ Add and remove item groups
- - โ Sub-menu support (ox_lib)
- - โ Enable and disable the wheel
- - โ Auto-register qb-radialmenu callbacks
- - โ Server: push and remove items per player or globally
- **Dispatch**
- - โ Send alerts with code, blip, plate, weapon, and priority
- - โ Shorthand for police, EMS, and fire
- - โ Multi-job alert support
- - โ Server relay fallback when no dispatch resource found
- **Target**
- - โ Entity, box zone, sphere zone, and model targets
- - โ Job and item restrictions per option
- - โ Auto-register qb-target callbacks
- - โ Remove entity, zone, and model targets
- - โ Server: push and remove zones and models per player or globally
- **Door Locks**
- - โ Register, lock, unlock, and toggle doors
- - โ Authorised job and grade per door
- - โ Server: door states synced to all clients
- - โ Server: new players receive all door states on join
- - โ Native entity freeze fallback if no system found
- **Gang**
- - โ Get gang name, grade, grade label, and display label
- - โ Check if player is boss, in a gang, or matches specific gangs
- - โ Minimum grade check on gang membership
- - โ Normalised data table โ consistent keys across all bridges
- - โ op-crime detected before qb-core (correct op-framework name)
- - โ Standalone gang systems always checked before framework built-ins
- - โ Listen for gang changes via event
- - โ Server: set and remove gang, get online members and bosses
- - โ Server: notify all members or bosses of a gang