# Admin Manager for CS2
**The complete admin system for your Counter-Strike 2 server: admins, groups, bans, gags, warnings and every admin command in one plugin, all stored in your MySQL database.**
*by illusion @ CodeStrike*
---
## Why Admin Manager?
- **One plugin instead of five.** Admins, groups, bans, mutes, warnings, player commands, server commands, admin chat and menus are all included.
- **Everything lives in your database.** No more editing `admins.json` by hand. Add an admin once and they are an admin on every server that uses the same database.
- **Changes apply instantly.** Add, remove or change an admin, in game or on your website, and the player gets or loses their rights without reconnecting.
- **Moving from SimpleAdmin takes one command.** Admins, groups, bans, gags, warnings and even your command permissions come over automatically.
- **Works with your other plugins.** Chat tags, VIP, menus and anything else that checks admin permissions or admin groups keep recognising your admins.
- **You decide who can do what.** Every single command has its own permission, which you can change in one easy file.
- **English and Bulgarian included**, and you can add any other language.
---
## Features
### 👮 Admins & groups
- Create **groups** (Owner, Admin, Moderator, ...) with their own permissions and immunity, then put admins in a group.
- Give an admin a group, extra permissions of their own, or both.
- **Group inheritance**: make *Admin* automatically include everything *Moderator* has, plus more.
- **Temporary admins**: give access for 7 days, 30 days or any time you like. It is removed automatically when it runs out.
- Admins get a reminder when they join: *"Your admin access expires in 2 days."*
- **Immunity**: lower admins can never punish higher ones.
- **Multiple servers**: share admins across all your servers, or limit an admin to one server.
- **Real CounterStrikeSharp groups**: every admin is also placed in a group with the name of their Admin Manager group (and the groups it inherits), so plugins that check groups, like chat tags or VIP, work out of the box.
### 🔨 Punishments
- **Ban** by player or SteamID, for a set time or permanently. Every ban blocks both the **Steam account and the IP**, so a second account on the same connection can't get around it. Banned players are kicked as soon as they try to join.
- **Gag** (chat), **Mute** (voice) or **Silence** (both). These can't be dodged by reconnecting and work on every server.
- **Warnings** with automatic punishments, for example *3 warnings = kick, 4 warnings = 1 hour ban*.
- **Kick**, **Slap** and **Slay**.
- Offline punishments: ban or gag a SteamID even when the player is not online.
- The punished player always sees who punished them, why, and for how long.
### 🎮 Player & server commands
- Move players between teams, rename, freeze, respawn, teleport (bring / goto), noclip, god mode, health, speed and gravity.
- Change the map (workshop maps too), restart the game, change cvars, run server commands.
- **Admin chat**: `@message` in team chat goes straight to the online admins. Regular players can use it to report someone.
- Announcements in chat, the center of the screen or the HUD, plus private messages.
- `!who` and `!players` show everything about a player at a glance.
### 📋 Menus
- **`!admin`**: pick a player, choose an action (kick, gag, ban, warn, ...), choose a time and a reason. Done.
- **`!am`**: manage admins and groups without typing a single command.
- Admins only see the actions they are allowed to use.
### 🕵️ Stealth mode
- **`!hide`**: watch the server as an invisible spectator.
- You are not on the scoreboard, not in anyone's spectator list, and there are no join, leave or team messages about you.
- Punishments you give while hidden are only shown to other admins.
- `!hide` again, or joining a team, makes you visible.
- Optional: admins join hidden automatically.
- Also hides you from the `status` console command when a Metamod status-hiding plugin is installed.
### 👀 For your players
- **`!admins`** shows which admins are online right now.
- Admins can hide themselves from the list with `!adminhide`.
### 📝 Logs & Discord
- Every admin change and every punishment is logged: who did what, to whom, when and why.
- **Discord notifications** with clean embeds for bans, gags, warnings, admin changes and more.
- Admin and group changes made directly in the database or on your website are logged too.
### 🌍 Languages
- English and Bulgarian are included. Switch with one setting.
- Every message can be edited, and colours are supported.
- Add your own language by copying one file.
---
## Commands
All commands work in chat with `!` (visible) or `/` (silent), and in the server console with `css_`.
| Command | What it does |
|---|---|
| `!admin` | Punishment menu |
| `!am` | Admin management menu |
| `!ban <player> [time] [reason]` | Ban a player (Steam account + IP) |
| `!addban <steamid> [time] [reason]` | Ban an offline player |
| `!unban <steamid/ip>` | Remove a ban |
| `!kick <player> [reason]` | Kick a player |
| `!gag` / `!mute` / `!silence <player> [time] [reason]` | Block chat / voice / both |
| `!ungag` / `!unmute` / `!unsilence <player>` | Lift it again |
| `!warn <player> [time] [reason]` | Warn a player |
| `!warns` / `!unwarn <player>` | Show / remove warnings |
| `!slap <player> [damage]` · `!slay <player>` | Slap / slay |
| `!team <player> <t/ct/spec>` | Move to a team |
| `!rename <player> <name>` | Rename a player |
| `!freeze` / `!unfreeze <player>` | Freeze a player |
| `!respawn` · `!noclip` · `!god <player>` | Fun commands |
| `!bring` / `!goto <player>` | Teleport |
| `!hp` · `!speed` · `!gravity <player> <value>` | Health, speed, gravity |
| `!map <map>` · `!wsmap <id>` | Change the map |
| `!rr` | Restart the game |
| `!rcon <command>` · `!cvar <cvar> [value]` | Server commands |
| `!asay` · `!say` · `!csay` · `!hsay` · `!psay` | Admin chat and announcements |
| `!who <player>` · `!players` | Player information |
| `!admins` · `!adminhide` | Online admin list |
| `!hide` | Invisible spectator mode for admins |
**Time** can be written as `30` (minutes), `12h`, `7d`, `4w`, or `0` for permanent.
**Player** can be a name, `#userid`, a SteamID, or a group such as `@t`, `@ct` or `@all`.
Admin management (from the console or by the owner):
`css_am_add`, `css_am_remove`, `css_am_list`, `css_am_group_add`, `css_am_group_remove`, `css_am_group_inherit`, `css_am_groups`, `css_am_logs`, `css_am_reload`, `css_am_import_simpleadmin`.
---
## Permissions made simple
Every command has its own line in **`commands.json`**:
```json
"god": { "Enabled": true, "Permission": "@css/cheats", "Commands": ["god"] },
"slay": { "Enabled": true, "Permission": "@css/slay", "Commands": ["slay", "kill"] },
"who": { "Enabled": true, "Permission": "", "Commands": ["who"] }
```
- **Change a permission** by editing one word. You can even make up your own, such as `@css/god`.
- **Leave it empty** (`""`) and every player can use the command.
- **Add extra names**: `["slay", "kill"]` makes both `!slay` and `!kill` work.
- **Switch a command off** with `"Enabled": false`.
The default permissions follow SimpleAdmin, with health, speed and gravity a little stricter by default, and the SimpleAdmin import copies your exact setup, so your admins keep the access they are used to.
---
## Coming from SimpleAdmin?
One command moves everything over:
```
css_am_import_simpleadmin ← shows what will be imported (nothing is changed)
css_am_import_simpleadmin confirm ← imports it
```
It brings over:
- ✅ All admins and groups, with their permissions, immunity and expiry dates
- ✅ All active bans, gags, mutes, silences and warnings, with the remaining time
- ✅ Your command permissions and command names, exactly as you had them
- ✅ Groups that exist twice in SimpleAdmin are merged into one, just like SimpleAdmin does in game
- ✅ `!hide` replaces SimpleAdmin's hide command and its Stealth module
Your SimpleAdmin data is only read, never changed or deleted. You can run the import again at any time, and nothing will be duplicated.
**Your other plugins keep working.** Chat tags, VIP and menu plugins that check admin groups (like `#Staff`) still recognise your admins: every admin is placed in a group with the same name as their Admin Manager group. Group names cannot contain spaces, so a SimpleAdmin group `#Staff Manager` becomes `#Staff_Manager` - update that name in those plugins' configs.
If SimpleAdmin is still installed, Admin Manager warns you and switches it off automatically, so the two never get in each other's way.
---
## Requirements
- **CounterStrikeSharp** v1.0.368 or newer
- **MySQL** or **MariaDB** database
- **MenuManager** *(optional)*, needed only for the `!admin` and `!am` menus
---
## Installation
1. Copy the `AdminManager` folder into `addons/counterstrikesharp/plugins/`.
2. Start the server once. The settings files are created for you.
3. Open `addons/counterstrikesharp/configs/plugins/AdminManager/AdminManager.json` and enter your database details.
4. Restart the server. The database tables are created automatically.
5. Make yourself an admin from the server console:
```
css_am_group_add Owner @css/root 100
css_am_add <your SteamID64> Owner
```
That's it. Type `!am` in game to manage everything from the menu.
---
## Settings at a glance
**`AdminManager.json`**: the main settings
- Database connection
- Language (`en` / `bg`) and the chat prefix
- Default times for bans, gags and warnings, and the warning punishments
- Who sees punishment announcements (everyone, admins only, or nobody)
- Stealth mode: hide admins automatically when they join
- Whether admins are also placed in CounterStrikeSharp groups (on by default)
- Discord webhook
- Server ID, if you run several servers on one database
**`commands.json`**: every command, its permission and its names
**`lang/en.json`, `lang/bg.json`**: every message the plugin shows
All files are created automatically with sensible defaults. Mistakes are reported clearly in the server console, and the plugin keeps working.
---
## FAQ
**Do I need to restart when I add an admin?**
No. New admins get their rights instantly, even if they are already on the server.
**Can I add admins from my website?**
Yes. Write to the database and the server picks it up automatically within a minute.
**Can a banned player rejoin with a reconnect?**
No. Bans, gags and mutes are stored in the database and checked every time a player joins.
**Can a banned player come back with a second Steam account?**
Not from the same connection: every ban also blocks the player's IP. Your admins are never kicked because they share an IP with a banned player.
**I have several servers. Do I add admins on each one?**
No. Point all servers to the same database. You can still give someone admin on only one server.
**Will my other plugins still recognise the admins?**
Yes. Admin Manager gives admins normal CounterStrikeSharp permissions and puts them in CounterStrikeSharp groups, so plugins that check permissions (`@css/ban`) or groups (`#Admin`) work as usual.
**My chat tags / VIP plugin used SimpleAdmin group names with spaces. What now?**
Group names cannot contain spaces, so `#Staff Manager` becomes `#Staff_Manager` after the import. Change that name in the other plugin's config and it works again.
**Is there a hide / stealth mode like in SimpleAdmin?**
Yes, `!hide`. You become an invisible spectator: not on the scoreboard, not in the spectator list, and no join or leave messages.
**Can I translate the plugin?**
Yes. Copy `lang/en.json`, translate the texts and set the language in the config.