Back to vault
rps_lib

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
Be the first to review rps_lib

Related artifacts