Skip to content

Installing cc_lib

cc_lib has no hard dependencies. It starts on a bare server and adapts to whatever else is running, so the only thing that matters is start order: cc_lib looks at what is started when a resource first

cc_lib has no hard dependencies. It starts on a bare server and adapts to whatever else is running, so the only thing that matters is start order: cc_lib looks at what is started when a resource first uses it, so start your framework and the resources it should talk to first.

1. Files

  1. Download cc_lib-<version>.zip from your Cfx.re Keymaster (Granted Assets) or the Tebex download link.
  2. Unzip it into your resources folder, e.g. resources/[cartel]/cc_lib.
  3. The folder must be called cc_lib. Every Cartel script loads @cc_lib/init.lua; a folder named cc_lib-main or cc_lib-1.13.0 breaks them all.

2. server.cfg

Put ensure cc_lib after your core stack and before every Code Cartel resource.

Qbox

cfg
ensure oxmysql
ensure ox_lib
ensure qbx_core
ensure ox_inventory
ensure ox_target
# ... your phone, dispatch, keys, fuel, clothing ...
ensure cc_lib
ensure cc_yourscript

QBCore

cfg
ensure oxmysql
ensure qb-core
ensure qb-inventory      # or ox_inventory / qs-inventory / ...
ensure qb-target         # or ox_target
ensure cc_lib
ensure cc_yourscript

ESX Legacy

cfg
ensure oxmysql
ensure es_extended
ensure ox_inventory      # or your ESX inventory
ensure ox_target
ensure esx_billing       # optional, used by CC.billing
ensure cc_lib
ensure cc_yourscript

ox_core

cfg
ensure oxmysql
ensure ox_lib
ensure ox_core
ensure ox_inventory
ensure ox_target
ensure cc_lib
ensure cc_yourscript

Standalone (no framework) — just ensure cc_lib before your scripts. Money uses inventory items (money, black_money), there is no bank and no jobs; see COMPATIBILITY.md.

3. First boot

On start cc_lib prints:

  • a table of every category and the resource it picked (or fallback);
  • config.lua and server/config.lua: OK, or one line per problem in your config.

Type cc in the server console to print the table again (in game it needs the ACE cc_lib.diagnostics):

cfg
add_ace group.admin cc_lib.diagnostics allow

cc_validate re-checks the config files.

4. Configure (optional)

Everything works with the defaults. To change something open config.lua (public) or server/config.lua (webhooks, secret). Reference: CONFIG.md. After editing: restart cc_lib, then restart the resources that use it (or the server).

Already set cc:* convars in server.cfg? They keep working and win over config.lua.

5. Updating

  1. Back up your config.lua, server/config.lua and any locales/ file you changed.
  2. Replace the folder with the new version.
  3. Put your three files back. New settings added in an update have built-in defaults, so an old config.lua keeps working; CHANGELOG.md lists every new key.
  4. Restart the server (not just cc_lib — every Cartel resource loaded the old init).

cc_lib follows semantic versioning: a minor version (1.12 → 1.13) never changes a function a product calls; a major version (2.0) says so in the changelog.

6. Uninstalling

Remove ensure cc_lib and the folder. Every Code Cartel script will refuse to start with "cc_lib is not started" — that is expected; they need it.

Why cc_lib is not escrowed

Cartel products are escrowed; cc_lib cannot be. Other resources load its files across resources (@cc_lib/init.lua) and its modules with LoadResourceFile, and an encrypted file can only be read by its own resource. Shipping it open is also what lets you check exactly what it does with your server.