Documentation
Everything you need to install, configure, and manage CodeGuard on your FiveM server.
01 Requirements
Before installing CodeGuard, make sure you have:
- A FiveM server running a recent artifact build (recommended: latest recommended build from the FiveM changelogs).
- A valid license key — get one from the homepage by verifying it there once.
- A Discord server with permission to create webhooks, so CodeGuard can send you ban/detection alerts.
You do not need your own database or web server — ban records and screenshots are hosted for you automatically on CodeGuard's infrastructure.
02 Installation
- Verify your license key on the homepage and download the resource archive.
- Extract it into your server's
resources/folder. Rename the folder tocodeguardif it isn't already. - Add the following line to your
server.cfg, ideally near the top, before other resources that depend on player identifiers:
- Restart your server, or run
refreshthenensure codeguardin the server console. - Check your console for [CodeGuard]: License verified — if you see an error instead, double-check your license key in
config.lua.
03 Configuration
Open config.lua inside the resource folder. The most important fields:
Restart the resource (restart codeguard) after changing any config value.
04 Admin Commands
Available in-game and from the server console, for players with the admin ace permission:
| Command | Description |
|---|---|
| /cgban [id] [reason] | Manually ban a player and log it to Discord + the ban record page. |
| /cgunban [license] | Remove a ban by the player's license identifier. |
| /cgwarn [id] [reason] | Issue a warning without kicking or banning. |
| /cgstatus | Show whether CodeGuard is active and license status. |
05 Webhook Setup
- In Discord, go to Server Settings → Integrations → Webhooks → New Webhook.
- Name it (e.g. "CodeGuard Logs") and pick the channel where you want alerts to appear.
- Click Copy Webhook URL and paste it into
CodeGuard.DiscordWebhookLinkinconfig.lua.
Each detection or ban sends an embed with the player, the reason, a screenshot (when available), and a link to the full ban record.
06 Ban Records
Every ban gets its own page at codeguard.eu/bans/<id>, linked directly from the Discord embed. It shows the player's identifiers, hardware IDs, and the ban screenshot — so your Discord logs can stay short while the full detail is one click away.
07 How It Works
CodeGuard runs server-side, watching for patterns associated with common cheats. When something suspicious is confirmed:
- A screenshot is captured automatically.
- The player is banned (if
BanSystemis enabled) and dropped from the server. - The ban record — identifiers, reason, and screenshot — is stored and a permanent record page is generated.
- A Discord alert is sent with a link to that page.
08 Troubleshooting
Discord alerts aren't showing up
Double-check CodeGuard.DiscordWebhookLink is a full, valid webhook URL and that CodeGuard.DiscordLog is set to true.
"License verification failed" on startup
Make sure you copied the license key exactly (no extra spaces), and that it hasn't been entered on the homepage already for a different server if your license is single-use.
Ban record link shows "Record not found"
This usually means the resource couldn't reach CodeGuard's servers at the moment the ban happened. Check your server's outbound internet access and try banning again.