> For the complete documentation index, see [llms.txt](https://ccfivem.gitbook.io/ccfivem-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ccfivem.gitbook.io/ccfivem-docs/server-management/admin-cc_admin.md).

# Admin (cc\_admin)

**CrankChaos Admin**: staff menu with roles, player management, reports, bans, audit log, live map and developer tools.

## Features

* Freely definable roles with levels and permissions; staff duty with overhead tag
* More than 100 server-validated actions
* Player management online and offline: profile with money, inventory, vehicles and history, notes
* Bans with identifier and token matching and any duration; warnings with optional auto-ban
* Admin jail in its own zone (separate from police jail)
* Report system with categories and priorities; staff chat
* Noclip, spectate, inspector, names over heads, godmode, invisibility
* Vehicle tools (spawn, repair, tune, plate, delete, keys, add to garage)
* World tools (weather, time, density, clear area) – handed over to cc\_weather/00%20Overview\.md) when it runs
* Quick panel with personal quick actions; short chat commands (`/anoclip`, `/agoto` ...)
* Live map and money overview
* Queue with staff priority (off by default)
* Live console with redaction of sensitive values
* Audit log, optionally forwarded to Discord channels
* Duty outfit and player screenshots (both off by default)
* Optional file editor for trusted developers (off by default)

## Frameworks

ESX Legacy, QBCore and QBox, detected automatically via the framework bridge.

## Works with

cc\_ambulance/00%20Overview\.md), cc\_inventory/00%20Overview\.md), cc\_keys/00%20Overview\.md), cc\_fuel/00%20Overview\.md), cc\_lib/00%20Overview\.md), cc\_character/00%20Overview\.md), cc\_weather/00%20Overview\.md), cc\_dispatch/00%20Overview\.md), `screenshot-basic`. See Installation for what each adds.

{% hint style="info" %}
The program code is protected by Cfx asset escrow. `config/`, `locales/` and `shared/cc_framework.lua` stay editable.
{% endhint %}

## Pages

* Installation
* Configuration
* API
* FAQ

Need help? See Support.

## Installation

See also the general installation guide and dependencies.

### Requirements

| Resource                         | Required | Notes                                                                                                  |
| -------------------------------- | -------- | ------------------------------------------------------------------------------------------------------ |
| `oxmysql`                        | yes      | fxmanifest dependency                                                                                  |
| ESX Legacy / QBCore / QBox       | yes      | auto-detected                                                                                          |
| cc\_ambulance/00%20Overview\.md) | optional | revive/heal/kill via EMS; otherwise a built-in simple variant                                          |
| cc\_inventory/00%20Overview\.md) | optional | view/open inventory, items; falls back to `ox_inventory`, otherwise inventory features are unavailable |
| cc\_keys/00%20Overview\.md)      | optional | keys for spawned vehicles                                                                              |
| cc\_fuel/00%20Overview\.md)      | optional | fuel level of spawned vehicles                                                                         |
| cc\_lib/00%20Overview\.md)       | optional | shared notifications                                                                                   |
| cc\_character/00%20Overview\.md) | optional | duty outfit and clothing menu on a player                                                              |
| cc\_weather/00%20Overview\.md)   | optional | takes over weather and time                                                                            |
| cc\_dispatch/00%20Overview\.md)  | optional | map image for the live map                                                                             |
| `screenshot-basic`               | optional | player screenshots (off by default)                                                                    |

### Steps

1. Copy the folder to `resources/[crankchaos]/cc_admin`.
2. Add to `server.cfg` – after oxmysql and the framework, before scripts that use cc\_admin exports:

```cfg
ensure oxmysql
ensure es_extended      # or qb-core / qbx_core
ensure cc_lib           # optional
ensure cc_admin
```

3. Define at least one owner (see below).
4. Start the server, press `F11` or type `/admin`, then add staff under "Roles & Permissions".

### Database

No SQL import needed. All `cc_admin_*` tables are created on first start.

### Owners and permissions

Owners always have all permissions, even with an empty database. Either list identifiers in `Config.Owners` or grant the owner ACE:

```cfg
add_ace identifier.license:YOUR_LICENSE cc_admin.owner allow
```

This is the only ACE cc\_admin checks (`Config.OwnerAce`). All other permissions are assigned per role in the menu.

Staff can also be managed from the **server console**:

```
ccadmin roles
ccadmin staff <identifier> <role>
ccadmin unstaff <identifier>
```

### Discord logging (optional)

Webhooks go into `server.cfg`, never into the config. Always use `set`:

```cfg
set cc_admin_webhook_default "https://discord.com/api/webhooks/..."
set cc_admin_webhook_moderation "https://discord.com/api/webhooks/..."
```

{% hint style="danger" %}
Never use `setr` or `sets` for webhooks. `setr` sends the value to every client, `sets` shows it publicly in the server list.
{% endhint %}

Categories: `players`, `moderation`, `economy`, `vehicles`, `world`, `server`, `staff`, `reports`, `screenshot` (convar `cc_admin_webhook_<category>`). Missing categories fall back to `cc_admin_webhook_default`. Enable with `Config.Discord.enabled = true`.

## Configuration

Editable files:

* `config/config.lua` – commands, keys, owners, default roles, limits, reports, queue, Discord and more
* `config/permissions.lua` – list of permissions shown in the role editor
* `config/ui.lua` – language and look
* `locales/de.json`, `locales/en.json`
* `shared/cc_framework.lua` – framework bridge

Roles and permissions are managed **in the menu**, not in the config – except owners.

### Opening and keys

```lua
Config.Command = 'admin'
Config.Keys = {
    menu = 'F11',
    noclip = 'HOME',
    panel = 'INSERT',   -- quick panel
    names = '',         -- unbound by default
    focus = '',         -- mouse focus, unbound by default
}
```

All keys can be rebound in the FiveM key bindings.

### Owners

```lua
Config.Owners = {
    -- 'license:...', 'discord:...', 'fivem:...'
}
Config.OwnerAce = 'cc_admin.owner'
```

### Default roles

`Config.DefaultRoles` (`admin` level 80, `moderator` level 50, `supporter` level 20) is created **only on the very first start**. Afterwards the menu is authoritative. A role can only act on, edit or assign roles with a lower `level`.

### Duty

```lua
Config.Duty = {
    requireForTools = true,    -- noclip, godmode, invisible, names, inspector only on duty
    requireForActions = false, -- actions against players only on duty
    tag = true,
    tagDistance = 20.0,
}
```

### Limits and economy

```lua
Config.Limits = {
    money = 10000000, itemCount = 1000, reason = 255, note = 1000,
    announce = 300, jailMinutes = 1440, banDays = 3650,
    clearRadius = 300.0, deleteRadius = 150.0, plate = 8,
    vehicleSpawnsPerMinute = 12, auditPage = 50, message = 300,
    vehicleGivesPerMinute = 6,
}
Config.MoneyAccounts = { 'cash', 'bank' }
Config.BlackMoney = { enabled = true, account = 'black_money' }
```

Values above a limit are rejected, not silently capped.

`Config.PlayerFilters` defines quick filters for the player list (police, EMS, mechanic, taxi, staff). `Config.Mass` sets the cooldown (30 s) for actions against all players and whether kick-all keeps staff.

### Bans and warnings

```lua
Config.Bans = {
    durations = { 1, 6, 24, 72, 168, 720, 0 },  -- hours, 0 = permanent
    matchIp = true,
    matchTokens = true,
    extend = true,    -- add newly seen identifiers to the ban
    failOpen = true,  -- let players in if the database is down
    appeal = '',      -- shown in the rejection text
}
Config.Warnings = { autoBanAt = 0, autoBanHours = 24 }  -- 0 = off
```

{% hint style="warning" %}
`matchIp` also affects innocent players sharing an IP (shared flats, internet cafés).
{% endhint %}

### Admin jail

```lua
Config.Jail = {
    coords = vector4(501.8, 5604.3, 797.9, 180.0),   -- Mount Chiliad summit
    radius = 25.0,
    release = vector4(-542.6, -208.6, 37.6, 210.0),
}
```

Time only runs while the player is online and survives reconnects.

### World

```lua
Config.World = {
    sync = true,
    force = false,
    conflicts = { 'qb-weathersync', 'vSync', 'cd_easytime', 'Renewed-Weathersync', 'esx_weathersync' },
    weather = 'EXTRASUNNY', hour = 12, minute = 0,
    minuteMs = 2000,
    presets = { { id = 'morning', hour = 7, minute = 0, weather = 'EXTRASUNNY' }, ... },
}
```

The built-in sync switches itself off if a conflicting script runs (unless `force`). With cc\_weather/00%20Overview\.md) running, weather and time are handed over.

### Tools

* `Config.Noclip` – `speeds`, `defaultSpeed = 3`, `invisible = true`
* `Config.Names` – `distance = 80.0`, `blipInterval = 2500`
* `Config.Inspector` – `distance = 80.0`
* `Config.Vehicles` – `useCatalog = true` (dealership catalog), `extra` models, `skipOccupied = true`
* `Config.Peds` – ped list, `allowCustom = true`, `blocked` patterns (`a_c_*` animals etc.)
* `Config.QuickActions` – default quick actions for new staff

### Server

```lua
Config.Resources = {
    protected = { 'oxmysql', 'es_extended', 'qb-core', 'qbx_core', 'ox_lib', ..., 'cc_inventory', 'cc_keys', 'cc_banking' },
}
Config.Console = { buffer = 400, flushMs = 300, maxLine = 600, redact = { ... } }
```

Protected resources cannot be stopped or restarted from the menu; cc\_admin is always protected. `redact` patterns hide license keys, database URLs, passwords, tokens and webhook URLs in the live console. IP addresses are only shown with `players.ip`.

### Reports

```lua
Config.Reports = {
    command = 'report',
    cooldown = 60, maxOpen = 3, textMax = 500,
    categories = { { id = 'question', priority = 'low' }, ... },
    cleanupDays = 0,   -- delete closed tickets after N days, 0 = never
}
```

### Queue

```lua
Config.Queue = {
    enabled = false,
    slots = nil,          -- nil = sv_maxclients - 1
    staffPriority = 100,
    graceSeconds = 90,
}
```

### Short commands

```lua
Config.Commands = {
    enabled = true,
    prefix = 'a',          -- 'a' + 'heal' = /aheal
    names = { noclip = 'noclip', heal = 'heal', ['goto'] = 'goto', ... },
    reloadPed = 'reloadped',
}
```

Set a name to `false` to disable that command. Each command goes through the same checks as the menu button.

### Discord, staff chat, extras

* `Config.Discord` – `enabled = false`, per-category switches, `username`, `perSecond = 2`. Webhook URLs belong in `server.cfg` (see Installation).
* `Config.StaffChat` – `enabled = true`, `history = 100`, `maxLength = 300`, `rate = 1500`, `keepDays = 14`
* `Config.LiveMap` – `enabled = true`, `interval = 2000`, `jobIcons`
* `Config.DutyOutfit` – `enabled = false`, `male`/`female` pieces (needs cc\_character/00%20Overview\.md))
* `Config.Screenshot` – `enabled = false`, `notifyPlayer = true`, `quality = 0.7`, `maxBytes` (needs `screenshot-basic`)

### Developer file editor

```lua
Config.Dev = {
    editor = false,
    resources = { 'cc_*' },
    maxBytes = 49152,
    extensions = { 'lua', 'json', 'js', ... },
}
```

{% hint style="danger" %}
Anyone allowed to write Lua files can run arbitrary code on the server after the next resource restart. Only enable the editor if exclusively trusted people hold `dev.editor`. cc\_admin itself is always locked.
{% endhint %}

### Permissions list

`config/permissions.lua` defines the permissions assignable to roles, grouped as `players.*`, `self.*`, `vehicles.*`, `world.*`, `server.*`, `reports.*`, `bans.*`, `warnings.manage`, `staff.*`, `roles.manage`, `audit.view`, `queue.manage` and `dev.editor`. `players.screenshot` and `dev.editor` are not in any default role.

## Exports, Events & Commands

### Commands and keys

| Command / key                                                                                    | Who                      | Purpose                                 |
| ------------------------------------------------------------------------------------------------ | ------------------------ | --------------------------------------- |
| `/admin`, `F11` (`cc_admin_menu`)                                                                | staff                    | open the menu                           |
| `HOME` (`cc_admin_noclip`)                                                                       | permission `self.noclip` | noclip                                  |
| `INSERT` (`ccadm_quickpanel`)                                                                    | staff                    | quick panel                             |
| `ccadm_mouse_focus`, `ccadm_names_toggle`                                                        | staff                    | mouse focus / names; unbound by default |
| `/report`                                                                                        | all players              | create a report                         |
| `/a<command>` (e.g. `/anoclip`, `/agoto`, `/abring`, `/aheal`, `/arevive`, `/aunban`, `/apanel`) | per permission           | short commands from `Config.Commands`   |
| `/reloadped`                                                                                     | all players              | reload saved ped                        |
| `ccadmin roles` / `staff <id> <role>` / `unstaff <id>`                                           | server console only      | list roles, add/remove staff            |

### Server exports

All exports are server-side only.

| Export                              | Parameters                                    | Returns                                           |
| ----------------------------------- | --------------------------------------------- | ------------------------------------------------- |
| `IsStaff(src)`                      | player ID                                     | `boolean` – has a role or is owner                |
| `HasPermission(src, perm)`          | player ID, permission (e.g. `'players.kick'`) | `boolean`                                         |
| `IsOnDuty(src)`                     | player ID                                     | `boolean`                                         |
| `GetRole(src)`                      | player ID                                     | `{ name, label, level, owner }` or `nil`          |
| `Log(src, action, target, details)` | actor, action, target, details                | `boolean` – audit entry `ext.<resource>.<action>` |
| `Ban(src, reason, hours)`           | player ID, reason, hours (`0` = permanent)    | `boolean`                                         |

```lua
if exports.cc_admin:HasPermission(source, 'players.kick') then
    exports.cc_admin:Log(source, 'kick', target, 'Reason: AFK')
end

-- Anticheat: ban for 24 hours
exports.cc_admin:Ban(playerId, 'Speedhack detected', 24)
```

### Server events

Subscribe with `AddEventHandler`:

* `cc_admin:audit` `(action, src, target, details, actorName)` – every audit entry
* `cc_admin:dutyChanged` `(src, onDuty)` – admin duty on/off

### State bags

* `Player(src).state.ccAdminDuty` – `true` while on duty
* `Player(src).state.ccAdminNoclip`, `ccAdminFrozen` – noclip / frozen
* `GlobalState.ccWorld`, `GlobalState.ccDensity` – weather/time and density when cc\_weather is not running

## FAQ & Troubleshooting

**The menu doesn't open for me.** You are not staff yet. Add yourself as owner via `Config.Owners` or `add_ace identifier.license:YOUR_LICENSE cc_admin.owner allow`, or run `ccadmin staff <identifier> <role>` in the server console.

**Everyone is locked out of the menu.** Owners always keep all permissions, even with broken roles or an empty database. Add an owner as above.

**I changed `Config.DefaultRoles` but nothing happens.** Default roles are only created on the very first start. Edit roles in the menu under "Roles & Permissions".

**I can't act on another staff member.** You can only act on roles with a lower `level` than your own.

**Noclip / godmode doesn't work.** With `Config.Duty.requireForTools = true` these tools only work while on admin duty.

**Inventory features are missing.** They require cc\_inventory/00%20Overview\.md) or `ox_inventory`.

**Screenshot button is missing.** Enable `Config.Screenshot.enabled`, run `screenshot-basic` and grant `players.screenshot` to a role.

**Weather/time buttons do nothing.** If cc\_weather/00%20Overview\.md) runs, it takes over weather and time. If another weather script runs, the built-in sync disables itself (`Config.World.conflicts`).

**No Discord logs arrive.** Set `Config.Discord.enabled = true` and define `cc_admin_webhook_default` (or a category convar) with `set` in `server.cfg`.

**Players are rejected by the queue.** The queue is off by default. When enabled it waits from `Config.Queue.slots` players (default `sv_maxclients - 1`).

Still stuck? See Support.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://ccfivem.gitbook.io/ccfivem-docs/server-management/admin-cc_admin.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
