cc_lib
The Code Cartel compatibility layer. One Lua API across ESX Legacy, QBCore, Qbox, ox_core, ND_Core and no framework at all — and across the inventory, banking, billing, target, notification, progress,
The Code Cartel compatibility layer. One Lua API across ESX Legacy, QBCore, Qbox, ox_core, ND_Core and no framework at all — and across the inventory, banking, billing, target, notification, progress, menu, phone, dispatch, keys, fuel, clothing, garage, door and weather resources your server already runs. Each category is detected at runtime, can be forced in config.lua, and falls back to a working built-in when nothing is installed.
Every Code Cartel script needs it. It is free, ships open source (not escrowed), and costs ~0.00 ms: it runs no threads at rest and loads only the modules a resource actually uses.
| Version | 1.13.0 — see CHANGELOG.md |
| Needs | nothing (FXServer with Lua 5.4; OneSync recommended) |
| Frameworks | ESX Legacy, QBCore, Qbox, ox_core, ND_Core, standalone |
| Docs | INSTALL · CONFIG · API / exports · COMPATIBILITY · TROUBLESHOOTING |
Install in 60 seconds
- Put the
cc_libfolder in yourresources(keep the name cc_lib). - In
server.cfg, start it after your framework and inventory and before any Code Cartel script:cfgensure ox_lib # if you use it ensure qbx_core # or es_extended / qb-core / ox_core ensure ox_inventory # your inventory, target, phone, etc. ensure cc_lib ensure cc_yourscript - Restart the server and read the table cc_lib prints: it lists what it detected for every category. Type
ccin the console any time to print it again.
Full steps per framework, updating and uninstalling: INSTALL.md.
What it does for you
- Detects your stack. Framework, inventory, banking/society, billing, target, notify, progress bar, text UI, menu, skill check, phone, dispatch, vehicle keys, fuel, clothing/appearance, garages, doors and weather. 90+ resources — full list in COMPATIBILITY.md.
- Lets you override everything.
config.lua→Config.Bridge.<category> = 'my-fork'(or'none'). Renamed forks work. - Never crashes your server over a missing resource. No inventory? Items fall back to the framework. No target? A native
[E]prompt. No dispatch? A blip + notification for allow-listed jobs. No phone? A notification. - Security built in.
CC.security.eventgates every net event a Cartel script registers: typed arguments, cooldowns, one-in-flight locks, distance, job/gang, alive, single-use tickets, ACE admin checks. Read EXPORTS.md → CC.security. - Logs owners trust. Discord webhooks with batching and 429 backoff, mention-safe text, plus a local
cc_lib:logevent and Fivemanage / ox_lib mirrors. - Checks your config at boot. A typo prints one red line naming the setting; the default is used, the server keeps running. Console:
cc_validate.
Configuration at a glance
| File | Who reads it | What goes in it |
|---|---|---|
config.lua | server and players (public) | adapter overrides, log level, locale, branding, boost window |
server/config.lua | server only (secret) | Discord webhook URLs |
locales/*.lua | server and players | the few strings cc_lib shows itself |
Every setting also has a cc:* convar, which wins over the file — so existing server.cfg setups keep working. Reference: CONFIG.md.
For developers
-- fxmanifest.lua of your resource
shared_script '@cc_lib/init.lua'
dependency 'cc_lib'-- server
CC.security.event('myjob:collect', {
cooldown = 1000, exclusive = true, alive = true,
args = { { name = 'index', type = 'number', integer = true, min = 1, max = #Rewards } },
}, function(src, index)
if CC.inventory.canCarry(src, Rewards[index].item, 1) then
CC.inventory.addItem(src, Rewards[index].item, 1)
CC.notify.send(src, { description = 'Collected', type = 'success' })
end
end)Not Lua? exports.cc_lib:call('money', 'add', src, 'bank', 500, 'myjob:payout') works from JavaScript and C#. The whole API, every module and export: EXPORTS.md.
Support
Paste the output of the cc console command with every ticket — it shows your artifact, OneSync mode, gamebuild and every adapter cc_lib picked. Common errors and their fixes: TROUBLESHOOTING.md.
Licence
Free, including on commercial servers and inside your own resources. See LICENSE.md.