Skip to content

Plugin Configuration Reference

Config File Location

  • Config file: configs/plugins/CS2Inspect/CS2Inspect.json
  • Reference template: configs/config.example.json

The config file is created automatically on first run with default values. If the database section is invalid or the required gamedata/cs2inspect.json file is missing, the plugin logs an error and unloads immediately.


Database Settings (Required)

All five database settings must be non-empty. The plugin will unload if any are missing.

SettingTypeDefaultDescription
DatabaseHoststring""MariaDB server hostname or IP
DatabasePortint3306MariaDB server port
DatabaseUserstring""Database username
DatabasePasswordstring""Database password
DatabaseNamestring""Database name

Same Database as Web App

These must point to the same MariaDB database used by your CS2Inspect web application. The plugin and web app share the same wp_player_* tables.

Connection pooling is handled internally (up to 640 connections). No manual tuning needed.


General Settings

SettingTypeDefaultDescription
ConfigVersionint11Internal schema version. Do not change unless a plugin update instructs you to.
SkinsLanguagestring"en"Language code for command messages. Corresponds to JSON files in the lang/ directory.
MenuTypestring"selectable"How in-game menus render. The default is recommended.

Feature Toggles (Additional)

These settings control which features are enabled. Disabling a feature bypasses its handlers and database lookups entirely.

SettingTypeDefaultDescription
KnifeEnabledbooltrueEnable knife system (!knife, knife loadout data)
KnifeDroppingEnabledboolfalseSet mp_drop_knife_enable 1 so knives can be dropped. Toggleable at runtime via !cs2inspect dropknife.
KnifeShortCommandsEnabledbooltrueEnable per-knife shortcuts (!karambit, !butterfly, etc.)
DisabledKnifeCommandsstring[][]Knife aliases to disable (case-insensitive). E.g., ["karambit", "m9"]
GloveEnabledbooltrueEnable glove system (!glove, !gloves)
MusicEnabledbooltrueEnable music kit system (!music)
AgentEnabledbooltrueEnable custom agent models (!agent)
SkinEnabledbooltrueEnable weapon skin application (loadouts and !g)
PinsEnabledbooltrueEnable pins (!pin)
ShowSkinImagebooltrueShow a preview image for the player's current weapon skin via center HTML
HideChatCommandMessagesbooltrueWhen the chat handler is active, hide command messages from public chat

Permission Settings (Additional)

CS2Inspect integrates with CounterStrikeSharp's admin system for optional command restrictions.

Global Permission

SettingTypeDefaultDescription
RequiredCommandPermissionstring""Permission required for all CS2Inspect player commands. Empty = no restriction.

Per-Category Permissions (CommandPermissions)

Checked in addition to RequiredCommandPermission. Empty string = no category restriction.

KeyControls
Knives!knife and all knife shortcuts
Gloves!glove, !gloves and glove shortcuts
Weapons!g, !weapon and weapon shortcuts
Music!music
Pins!pin
Agents!agent

Example: Only VIPs can use weapon commands:

json
"RequiredCommandPermission": "",
"CommandPermissions": {
  "Knives": "",
  "Gloves": "",
  "Weapons": "@css/vip",
  "Music": "",
  "Pins": "",
  "Agents": ""
}

Logging Configuration (Logging)

Global Level

SettingTypeDefaultDescription
GlobalLogLevelstring"Info"Minimum log level: Debug, Info, Warning, Error, Success
ShowTimestampbooltrueInclude timestamp in log output
ShowCategorybooltrueInclude category name in log output
PluginPrefixstring"CS2Inspect"Prefix for all log messages

Per-Category Levels (Categories)

Override the global level for specific subsystems:

CategoryDefaultWhat It Logs
DatabaseInfoDatabase queries, connection events
CommandsInfoCommand parsing, execution
WeaponsInfoWeapon skin application
HandlersInfoHandler operations
EventsInfoGame event processing
PerformanceWarningPerformance metrics
SecurityWarningPermission checks, security events
ConfigurationInfoConfig loading, validation
MenuInfoMenu operations
NetworkInfoNetwork operations
ErrorHandlingErrorError handling flow

Production Tip

Set Database and Performance to Warning or higher on production servers to reduce noise. Use Debug level temporarily when diagnosing issues.

File Logging (FileLogging)

SettingTypeDefaultDescription
EnabledbooltrueWrite logs to disk
LogDirectorystring"logs/CS2Inspect"Directory relative to game server root
MaxFileSizestring"10MB"Max size per log file
MaxFilesint5Max number of log files (rotation)
FileNamePatternstring"cs2inspect-{date:yyyy-MM-dd}.log"File naming pattern
MinimumLogLevelstring"Debug"Minimum level for file logs (can differ from console)
IncludeColorsboolfalseInclude color codes in file output
AutoFlushbooltrueFlush after each write

Performance Logging (Performance)

SettingTypeDefaultDescription
AsyncLoggingbooltrueQueue logs for background writing
BufferSizeint1000Log queue buffer size
FlushIntervalint5000Flush interval in milliseconds
IncludeStackTraceboolfalseInclude stack traces (noisy)
MaxMessageLengthint2000Truncate messages exceeding this length

Log levels can also be tuned at runtime via admin commands without editing the config file. See Admin Commands.


Weapon Command Shortcuts (WeaponCommands)

Enables per-weapon shortcuts that wrap !g:

SettingTypeDefaultDescription
EnabledboolfalseEnable weapon shortcut commands
ReplaceWeaponOnGivebooltrueWhen GiveWeapon is true, replace the existing weapon

Per-Weapon Configuration (Weapons)

Each weapon entry:

KeyTypeDescription
EnabledboolEnable this shortcut
CommandstringCommand name (e.g., "awp" for !awp)
GiveWeaponboolAlso give the weapon to the player (not just apply skin)

Example:

json
"WeaponCommands": {
  "Enabled": true,
  "ReplaceWeaponOnGive": true,
  "Weapons": {
    "awp": { "Enabled": true, "Command": "awp", "GiveWeapon": true },
    "ak47": { "Enabled": true, "Command": "ak47", "GiveWeapon": false },
    "m4a4": { "Enabled": true, "Command": "m4a4", "GiveWeapon": false },
    "m4a1s": { "Enabled": true, "Command": "m4a1s", "GiveWeapon": false }
  }
}

With this config, !awp p661 w.02 gives the player an AWP and applies the skin. !ak47 p661 only applies the skin (player must already have the weapon).


Knife Command Shortcuts (KnifeCommands)

Additional configurable knife shortcuts beyond the built-in ones (!karambit, etc.):

json
"KnifeCommands": {
  "Enabled": false,
  "ReplaceKnifeOnGive": true,
  "Knives": {}
}

Both built-in and configurable knife shortcuts support inline customization — you can append the same modular arguments used by !g to switch knife type and configure it in one command (e.g., !karambit doppler4 .02 s991 t444). See Plugin Commands for details and examples.


Glove Command Shortcuts (GloveCommands)

Configurable glove shortcuts:

json
"GloveCommands": {
  "Enabled": false,
  "Gloves": {}
}

Glove shortcuts also support inline customization with the same modular syntax (e.g., !sport superconductor .02 s991). Note that gloves do not support StatTrak or nametags. See Plugin Commands for details.


Required Files

gamedata/cs2inspect.json

This file must be present at addons/counterstrikesharp/gamedata/cs2inspect.json. The plugin will refuse to load without it. It ships with every plugin release and contains game data offsets that the plugin needs to modify CS2 entities.


Full Example Configuration

json
{
  "ConfigVersion": 11,
  "SkinsLanguage": "en",
  "DatabaseHost": "localhost",
  "DatabasePort": 3306,
  "DatabaseUser": "cs2inspect",
  "DatabasePassword": "your_password",
  "DatabaseName": "cs2inspect",
  "Additional": {
    "KnifeEnabled": true,
    "KnifeDroppingEnabled": false,
    "KnifeShortCommandsEnabled": true,
    "DisabledKnifeCommands": [],
    "GloveEnabled": true,
    "MusicEnabled": true,
    "AgentEnabled": true,
    "SkinEnabled": true,
    "PinsEnabled": true,
    "ShowSkinImage": true,
    "HideChatCommandMessages": true,
    "RequiredCommandPermission": "",
    "CommandPermissions": {
      "Knives": "",
      "Gloves": "",
      "Weapons": "",
      "Music": "",
      "Pins": "",
      "Agents": ""
    }
  },
  "MenuType": "selectable",
  "Logging": {
    "GlobalLogLevel": "Info",
    "ShowTimestamp": true,
    "ShowCategory": true,
    "PluginPrefix": "CS2Inspect",
    "Categories": {
      "Database": "Info",
      "Commands": "Info",
      "Weapons": "Info",
      "Handlers": "Info",
      "Events": "Info",
      "Performance": "Warning",
      "Security": "Warning",
      "Configuration": "Info",
      "Menu": "Info",
      "Network": "Info",
      "ErrorHandling": "Error"
    },
    "FileLogging": {
      "Enabled": true,
      "LogDirectory": "logs/CS2Inspect",
      "MaxFileSize": "10MB",
      "MaxFiles": 5,
      "FileNamePattern": "cs2inspect-{date:yyyy-MM-dd}.log",
      "IncludeColors": false,
      "MinimumLogLevel": "Debug",
      "AutoFlush": true
    },
    "Performance": {
      "AsyncLogging": true,
      "BufferSize": 1000,
      "FlushInterval": 5000,
      "IncludeStackTrace": false,
      "MaxMessageLength": 2000
    },
    "Formatting": {
      "TimestampFormat": "HH:mm:ss.fff",
      "PadLogLevels": true,
      "CompactFormat": false,
      "IncludeThreadId": false,
      "CustomFormat": null
    }
  },
  "WeaponCommands": {
    "Enabled": true,
    "ReplaceWeaponOnGive": true,
    "Weapons": {
      "awp": { "Enabled": true, "Command": "awp", "GiveWeapon": true },
      "ak47": { "Enabled": true, "Command": "ak47", "GiveWeapon": false },
      "m4a4": { "Enabled": true, "Command": "m4a4", "GiveWeapon": false },
      "m4a1s": { "Enabled": true, "Command": "m4a1s", "GiveWeapon": false }
    }
  }
}

Built with ❤️ by the CS2Inspect community