Konfiguration

Learn how to configure CS2-SimpleAdmin to suit your server's needs.

Konfiguration Datei Location

The main Konfigurationsdatei is located at:

addons/counterstrikesharp/configs/plugins/CS2-SimpleAdmin/CS2-SimpleAdmin.json

Konfiguration Structure

The Konfigurationsdatei is divided into several sections:

Datenbank-Konfiguration

Configure your database connection:

"DatabaseConfig": {
  "DatabaseType": "SQLite",
  "SqliteFilePath": "cs2-simpleadmin.sqlite",
  "DatabaseHost": "",
  "DatabasePort": 3306,
  "DatabaseUser": "",
  "DatabasePassword": "",
  "DatabaseName": "",
  "DatabaseSSlMode": "preferred"
}

Datenbank Types:

MySQL Beispiel:

"DatabaseConfig": {
  "DatabaseType": "MySQL",
  "DatabaseHost": "localhost",
  "DatabasePort": 3306,
  "DatabaseUser": "cs2admin",
  "DatabasePassword": "your_password",
  "DatabaseName": "cs2_simpleadmin",
  "DatabaseSSlMode": "preferred"
}

Weitere Einstellungen

General plugin settings:

"OtherSettings": {
  "ShowActivityType": 2,
  "TeamSwitchType": 1,
  "KickTime": 5,
  "BanType": 1,
  "TimeMode": 1,
  "DisableDangerousCommands": true,
  "MaxBanDuration": 10080,
  "MaxMuteDuration": 10080,
  "ExpireOldIpBans": 0,
  "ReloadAdminsEveryMapChange": false,
  "DisconnectedPlayersHistoryCount": 10,
  "NotifyPenaltiesToAdminOnConnect": true,
  "ShowBanMenuIfNoTime": true,
  "UserMessageGagChatType": false,
  "CheckMultiAccountsByIp": true,
  "AdditionalCommandsToLog": [],
  "IgnoredIps": []
}

Einstellungen Explained:

SettingDescriptionDefault
ShowActivityTypeHow to display admin actions (0=hide, 1=anonymous, 2=show name)2
TeamSwitchTypeTeam switch behavior1
KickTimeDelay before kicking player (seconds)5
BanTypeBan type (1=SteamID, 2=IP, 3=Both)1
TimeModeTime display mode1
DisableDangerousCommandsDisable potentially dangerous commandstrue
MaxBanDurationMaximum ban duration in minutes (0=unlimited)10080
MaxMuteDurationMaximum mute duration in minutes (0=unlimited)10080
ExpireOldIpBansAuto-expire IP bans after X days (0=disabled)0
ReloadAdminsEveryMapChangeNeu laden admin permissions on map changefalse
DisconnectedPlayersHistoryCountNumber of disconnected players to track10
NotifyPenaltiesToAdminOnConnectShow penalties to admins when they connecttrue
ShowBanMenuIfNoTimeShow ban menu even without time parametertrue
UserMessageGagChatTypeUse UserMessage for gag (alternative chat blocking)false
CheckMultiAccountsByIpDetect multiple accounts from same IPtrue
AdditionalCommandsToLogArray of additional commands to log[]
IgnoredIpsIPs to ignore in multi-account detection[]

Metriken und Updates

"EnableMetrics": true,
"EnableUpdateCheck": true

Zeitzone

Set your server's timezone for accurate timestamps:

"Timezone": "UTC"

See the list of timezones below.

Warn-Schwellenwerte

Configure automatic actions when players reach warning thresholds:

"WarnThreshold": {
  "998": "css_addban STEAMID64 60 \"3/4 Warn\"",
  "999": "css_ban #USERID 120 \"4/4 Warn\""
}

Beispiel: Automatically ban a player for 60 minutes when they receive their 3rd warning.

Multi-Server-Modus

Enable if you're running multiple servers with a shared database:

"MultiServerMode": true

When enabled:

Discord-Integration

Benachrichtigungen an Discord-Webhooks senden:

"Discord": {
  "DiscordLogWebhook": "https://discord.com/api/webhooks/...",
  "DiscordPenaltyBanSettings": [...],
  "DiscordPenaltyMuteSettings": [...],
  "DiscordPenaltyGagSettings": [...],
  "DiscordPenaltySilenceSettings": [...],
  "DiscordPenaltyWarnSettings": [...],
  "DiscordAssociatedAccountsSettings": [...]
}

Webhook Einstellungen: Each penalty type can have its own webhook configuration:

"DiscordPenaltyBanSettings": [
  {
    "name": "Color",
    "value": "#FF0000"
  },
  {
    "name": "Webhook",
    "value": "https://discord.com/api/webhooks/YOUR_WEBHOOK_HERE"
  },
  {
    "name": "ThumbnailUrl",
    "value": "https://example.com/ban-icon.png"
  },
  {
    "name": "ImageUrl",
    "value": ""
  },
  {
    "name": "Footer",
    "value": "CS2-SimpleAdmin"
  },
  {
    "name": "Time",
    "value": "{relative}"
  }
]

Available Placeholders:

Map-Konfiguration

Configure default maps and workshop maps:

"DefaultMaps": [
  "de_dust2",
  "de_mirage",
  "de_inferno"
],
"WorkshopMaps": {
  "aim_map": "123456789",
  "surf_map": "987654321"
}

Eigene Serverbefehle

Add custom commands to the admin menu:

"CustomServerCommands": [
  {
    "Flag": "@css/root",
    "DisplayName": "Reload Admins",
    "Command": "css_reloadadmins"
  },
  {
    "Flag": "@css/cheats",
    "DisplayName": "Enable sv_cheats",
    "Command": "sv_cheats 1"
  }
]

Configure menu appearance and options:

"MenuConfig": {
  "MenuType": "selectable",
  "Durations": [
    { "name": "1 minute", "duration": 1 },
    { "name": "5 minutes", "duration": 5 },
    { "name": "15 minutes", "duration": 15 },
    { "name": "1 hour", "duration": 60 },
    { "name": "1 day", "duration": 1440 },
    { "name": "7 days", "duration": 10080 },
    { "name": "14 days", "duration": 20160 },
    { "name": "30 days", "duration": 43200 },
    { "name": "Permanent", "duration": 0 }
  ],
  "BanReasons": [
    "Hacking",
    "Voice Abuse",
    "Chat Abuse",
    "Admin disrespect",
    "Other"
  ],
  "KickReasons": [
    "Voice Abuse",
    "Chat Abuse",
    "Admin disrespect",
    "Other"
  ],
  "WarnReasons": [
    "Voice Abuse",
    "Chat Abuse",
    "Admin disrespect",
    "Other"
  ],
  "MuteReasons": [
    "Advertising",
    "Spamming",
    "Spectator camera abuse",
    "Hate",
    "Admin disrespect",
    "Other"
  ],
  "AdminFlags": [
    { "name": "Generic", "flag": "@css/generic" },
    { "name": "Chat", "flag": "@css/chat" },
    { "name": "Change Map", "flag": "@css/changemap" },
    { "name": "Slay", "flag": "@css/slay" },
    { "name": "Kick", "flag": "@css/kick" },
    { "name": "Ban", "flag": "@css/ban" },
    { "name": "Perm Ban", "flag": "@css/permban" },
    { "name": "Unban", "flag": "@css/unban" },
    { "name": "Show IP", "flag": "@css/showip" },
    { "name": "Cvar", "flag": "@css/cvar" },
    { "name": "Rcon", "flag": "@css/rcon" },
    { "name": "Root (all flags)", "flag": "@css/root" }
  ]
}

Zeitzonenliste

UTC
America/New_York
America/Chicago
America/Denver
America/Los_Angeles
Europe/London
Europe/Paris
Europe/Berlin
Europe/Warsaw
Europe/Moscow
Asia/Tokyo
Asia/Shanghai
Asia/Dubai
Australia/Sydney
Pacific/Auckland
... (and many more)

For a complete list, see the info.txt file in the documentation folder.

Befehls-Konfiguration

You can customize command aliases in:

addons/counterstrikesharp/configs/plugins/CS2-SimpleAdmin/Commands.json

Beispiel:

{
  "Commands": {
    "css_ban": {
      "Aliases": [
        "css_ban",
        "css_ban2"
      ]
    }
  }
}

This allows you to:

Bewährte Vorgehensweisen

Sicherheit

  1. Use MySQL in production - SQLite is not suitable for multi-Server-Konfigurations
  2. Set MaxBanDuration - Prevent accidental permanent bans
  3. Enable DisableDangerousBefehle - Protect against accidental server crashes
  4. Use strong database passwords - If using MySQL

Leistung

  1. Set ReloadAdminsEveryMapChange to false - Unless you frequently modify admin permissions
  2. Limit DisconnectedPlayersHistoryCount - Reduce memory usage
  3. Use database indices - Migrations create these automatically

Multi-Server Setup

  1. Enable MultiServerMode - Share data across servers
  2. Use MySQL - Required for multi-server
  3. Configure server IDs - Each server gets a unique ID automatically
  4. Test penalties - Ensure bans work across all servers

Fehlerbehebung

Änderungen werden nicht übernommen

Solution: Neu laden the plugin or restart the server:

css_plugins reload CS2-SimpleAdmin

Discord-Webhooks funktionieren nicht

Solution:

TimeMode-Probleme

Solution: Set your timezone correctly in the configuration

Nächste Schritte