CodeGuard logo docs
← Back to codeguard.eu

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

  1. Verify your license key on the homepage and download the resource archive.
  2. Extract it into your server's resources/ folder. Rename the folder to codeguard if it isn't already.
  3. Add the following line to your server.cfg, ideally near the top, before other resources that depend on player identifiers:
ensure codeguard
  1. Restart your server, or run refresh then ensure codeguard in the server console.
  2. 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:

-- config.lua CodeGuard = {} CodeGuard.LicenseKey = "XXXX-XXXX-XXXX-XXXX" CodeGuard.DiscordWebhookLink = "https://discord.com/api/webhooks/..." CodeGuard.DiscordLog = true -- send detections/bans to Discord CodeGuard.CMDLog = true -- print detections in server console CodeGuard.BanSystem = true -- automatically ban confirmed cheaters CodeGuard.HideIP = false -- hide player IPs in Discord logs

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:

CommandDescription
/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.
/cgstatusShow whether CodeGuard is active and license status.

05 Webhook Setup

  1. In Discord, go to Server Settings → Integrations → Webhooks → New Webhook.
  2. Name it (e.g. "CodeGuard Logs") and pick the channel where you want alerts to appear.
  3. Click Copy Webhook URL and paste it into CodeGuard.DiscordWebhookLink in config.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:

  1. A screenshot is captured automatically.
  2. The player is banned (if BanSystem is enabled) and dropped from the server.
  3. The ban record — identifiers, reason, and screenshot — is stored and a permanent record page is generated.
  4. 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.