Skip to content

Framework Bridge

Directory: bridge/

Multi-framework abstraction layer. Allows the resource to work with QBCore, QBX, ESX, or standalone.

Files

FilePurpose
interface.luaShared bridge interface definition
qb.luaQBCore implementation
qbx.luaQBX implementation
esx.luaESX implementation
standalone.luaStandalone fallback

How It Works

  1. interface.lua defines Bridge table with standard methods
  2. Each framework file populates Bridge with framework-specific implementations
  3. Auto-detection in config.lua picks the right framework
  4. All server/client code uses Bridge.* methods

Bridge Methods

lua
-- Player
Bridge.GetPlayer(src) → player
Bridge.GetCitizenId(src) → citizenid
Bridge.GetName(src) → name
Bridge.GetMoney(src) → money
Bridge.AddMoney(src, amount)
Bridge.RemoveMoney(src, amount)
Bridge.Notify(src, message, type)

-- Framework detection
Bridge.GetFramework() → 'qbcore'|'qbx'|'esx'|'standalone'

Auto-Detection Order

lua
Config.Framework = 'auto'
-- Checks: qbx > qbcore > esx > standalone

Override with Config.FrameworkOverride if auto-detect picks wrong.

AIFAZI — FiveM Resources