Framework Bridge
Directory: bridge/
Multi-framework abstraction layer. Allows the resource to work with QBCore, QBX, ESX, or standalone.
Files
| File | Purpose |
|---|---|
interface.lua | Shared bridge interface definition |
qb.lua | QBCore implementation |
qbx.lua | QBX implementation |
esx.lua | ESX implementation |
standalone.lua | Standalone fallback |
How It Works
interface.luadefinesBridgetable with standard methods- Each framework file populates
Bridgewith framework-specific implementations - Auto-detection in
config.luapicks the right framework - 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 > standaloneOverride with Config.FrameworkOverride if auto-detect picks wrong.