A ghost mode plugin for CS2 servers running CounterStrikeSharp. Each player chooses whether they appear semi-transparent or normal to everyone else. Perfect for BHOP/surf/KZ servers.
- Per-player ghost toggle — Each player controls their own transparency with
!ghost - Semi-transparent look — Configurable alpha (default 175) for that classic ghost appearance
- Weapons & gloves included — Knife, gloves, and all weapons match the player's transparency
- Legs always hidden — First-person legs are hidden regardless of ghost ON/OFF (alpha 254 trick)
- MySQL/MariaDB persistence — Player preference saved to database, persists across reconnects
- Auto-generated config — Single
config.jsonwith all settings - Periodic refresh — Re-applies transparency every few seconds to prevent other plugins from overriding
- Default: All players join as semi-transparent (ghost ON)
!ghost— Toggles your own appearance:- Ghost ON = You appear semi-transparent to everyone (alpha 175)
- Ghost OFF = You appear normal/opaque to everyone (alpha 254)
- Setting is saved in DB — next time you join, your preference is remembered
Note: Transparency is a server-side entity property in Source 2. Each player controls how they look, not how they see others. This is an engine limitation — there is no per-viewer rendering in CS2.
- CounterStrikeSharp v1.0.364+
- MySQL or MariaDB — for saving player settings (optional — without it, settings reset on reconnect)
- Download the latest release from Releases
- Extract the
GhostPlayersfolder to:csgo/addons/counterstrikesharp/plugins/GhostPlayers/ - Make sure
GhostPlayers.dllandMySqlConnector.dllare both in the folder - Start/restart your server — a
config.jsonwill be auto-generated - Edit the config to your liking (see below)
csgo/addons/counterstrikesharp/
├── plugins/
│ └── GhostPlayers/
│ ├── GhostPlayers.dll
│ └── MySqlConnector.dll
└── configs/
└── plugins/
└── GhostPlayers/
└── config.json ← auto-created on first load
On first server start, the plugin auto-generates a config file at:
csgo/addons/counterstrikesharp/configs/plugins/GhostPlayers/config.json
Default config:
{
"ChatTag": "[Ghost]",
"ChatTagColor": "Purple",
"DefaultGhostEnabled": true,
"GhostAlpha": 175,
"RefreshIntervalSeconds": 5.0,
"Database": {
"Enabled": false,
"Host": "localhost",
"Port": 3306,
"Database": "cs2",
"User": "root",
"Password": "",
"TableName": "ghost_settings"
}
}| Option | Default | Description |
|---|---|---|
ChatTag |
[Ghost] |
Tag shown in chat messages |
ChatTagColor |
Purple |
Color of the tag. Options: Red, Blue, Green, Yellow, Orange, Purple, LightRed, LightBlue, LightPurple, DarkRed, DarkBlue, Grey, Olive, Lime, Gold, Silver |
DefaultGhostEnabled |
true |
Whether ghost mode is ON by default for new players |
GhostAlpha |
175 |
Alpha value when ghost is ON (0 = invisible, 254 = barely transparent). 175 = ~31% transparent |
RefreshIntervalSeconds |
5.0 |
How often to re-apply transparency (prevents other plugins from overriding). Set to 0 to disable |
| Option | Default | Description |
|---|---|---|
Database.Enabled |
false |
Set to true to enable MySQL/MariaDB persistence |
Database.Host |
localhost |
Database server address |
Database.Port |
3306 |
Database server port |
Database.Database |
cs2 |
Database name |
Database.User |
root |
Database username |
Database.Password |
"" |
Database password |
Database.TableName |
ghost_settings |
Name of the settings table |
The plugin automatically creates the database table on first connect. The ghost_settings table stores SteamID and Enabled per player.
No database? Leave
Database.Enabledasfalse— the plugin works fine without it, settings just won't persist between sessions.
| Command | Description |
|---|---|
!ghost |
Toggle your ghost mode ON/OFF |
[Ghost] Ghost ON (semi-transparent)
[Ghost] Ghost OFF (normal)
- Uses
CBaseModelEntity.Render(alpha channel) andRenderMode_t.kRenderTransAlpha - Ghost OFF uses alpha 254 (not 255) — this hides first-person legs while appearing fully opaque to others
- Transparency applied to player pawn + all weapons via
WeaponServices.MyWeapons Utilities.SetStateChanged()called on bothm_nRenderModeandm_clrRenderto network changes- Periodic timer re-applies render to prevent other plugins from overriding
dotnet build -c ReleaseOutput: bin/Release/net8.0/GhostPlayers.dll
MIT License — see LICENSE for details.