A CounterStrikeSharp plugin that allows CS2 server owners to place decals on maps at predefined locations. Players with admin permissions can place decals using ping locations, edit their properties (width, height, depth, position), and toggle visibility.
- Decal Placement: Place custom decals on maps using the ping system (right-click ping)
- Decal Management: Edit existing decals (reposition, resize, enable/disable)
- Permission System: Control who can place and see decals using CS# permissions
- Player Preferences: Players can toggle decal visibility with a command
- Database Support: Supports MySQL, PostgreSQL, and SQLite
- Multi-Map Support: Decals are saved per-map
- Force on VIP: Option to force certain decals to always show for VIP players
- Automated Builds: GitHub Actions for CI/CD and automated releases
- Install CounterStrikeSharp on your CS2 server
- Download the latest release from the Releases page
- Extract the plugin files to
game/csgo/addons/counterstrikesharp/plugins/MapDecals/ - Configure the plugin (see Configuration section)
- Restart the server or use
css_plugins load MapDecals
The plugin configuration file is located at:
game/csgo/addons/counterstrikesharp/configs/plugins/MapDecals/MapDecals.json
{
"DatabaseConnection": "Server=localhost;Database=cs2;User=root;Password=;",
"DatabaseType": "mysql",
"Props": [
{
"UniqId": "exampleTexture",
"Name": "Example Name",
"Material": "materials/Example/exampleTexture.vmat",
"ShowPermission": ""
}
],
"PlaceDecalCommands": {
"Command": "mapdecal",
"Aliases": ["paintmapdecal", "placedecals", "placedecal"],
"Permission": "cc-mapdecals.admin"
},
"AdToggleCommands": {
"Command": "decal",
"Aliases": ["decals"],
"Permission": "cc-mapdecals.vip"
}
}DatabaseConnection: Connection string for your databaseDatabaseType: Type of database (mysql,postgresql, orsqlite)
Props: Array of available decalsUniqId: Unique identifier for the decalName: Display name shown in menusMaterial: Path to the decal material (VMAT file)ShowPermission: Optional permission required to see the decal
-
PlaceDecalCommands: Configuration for the placement commandCommand: Main command nameAliases: Alternative command namesPermission: Permission required to use the command
-
AdToggleCommands: Configuration for the toggle commandCommand: Main command nameAliases: Alternative command namesPermission: Permission required to use the command
MySQL:
Server=localhost;Database=cs2;User=root;Password=yourpassword;
PostgreSQL:
Host=localhost;Database=cs2;Username=postgres;Password=yourpassword;
SQLite:
Data Source=/path/to/database.db;
!mapdecal(or configured command)- Opens the main menu for placing and managing decals
- Requires admin permission (default:
cc-mapdecals.admin) - Must be alive to use
!decal(or configured command)- Toggles visibility of non-forced decals
- Requires VIP permission (default:
cc-mapdecals.vip) - Preference is saved to database
- Use
!mapdecalcommand to open the menu - Select "Place New Decal"
- Choose a decal from the list
- Right-click ping (Radar ping) where you want to place the decal
- The decal will be placed and the edit menu will open automatically
- Use
!mapdecalcommand to open the menu - Select "Edit Existing Decals"
- Choose the decal you want to edit
- Select an edit option:
- Reposition: Ping a new location for the decal
- Adjust Width: Change the decal width (64, 128, 256, 512)
- Adjust Height: Change the decal height (64, 128, 256, 512)
- Adjust Depth: Change the decal depth (4, 8, 12, 16, 24)
- Force on VIP: Toggle whether the decal is always visible to VIPs
- Enable/Disable: Toggle the decal on/off
- Delete Decal: Remove the decal permanently
Players with VIP permission can toggle decal visibility:
- Use
!decalcommand to toggle decals on/off - This only affects non-forced decals
- Preference is saved across reconnects
Configure permissions in CounterStrikeSharp's admin system:
{
"Groups": [
{
"Name": "Admin",
"Permissions": [
"cc-mapdecals.admin"
]
},
{
"Name": "VIP",
"Permissions": [
"cc-mapdecals.vip"
]
}
]
}The plugin automatically creates the following tables:
Stores decal information:
id: Unique decal IDmap: Map namedecal_id: Reference to config UniqIddecal_name: Display nameposition: 3D position (X Y Z)angles: 3D rotation (X Y Z)depth: Decal depthwidth: Decal widthheight: Decal heightforce_on_vip: Whether to force show for VIPsis_active: Whether the decal is active
Stores player preferences:
steam_id: Player's SteamID64decals_enabled: Whether decals are enabled (1/0)
- .NET 8.0 SDK
- CounterStrikeSharp.API
- Clone the repository:
git clone https://github.com/JonneKahvila/CS2-MapDecals.git
cd CS2-MapDecals- Build the project:
cd MapDecals
dotnet build -c Release- The compiled plugin will be in
bin/Release/net8.0/
The repository includes automated GitHub Actions workflows for building and releasing the plugin. See RELEASE.md for detailed instructions on:
- Creating automated releases with version tags
- Using GitHub Actions for CI/CD
- Manual release creation
- Version numbering conventions
Quick release: Simply push a version tag to automatically build and create a GitHub release:
git tag v1.0.0
git push origin v1.0.0- Check that the material path is correct in the configuration
- Verify the VMAT file exists on the server
- Ensure players have the required permission to see the decal
- Check if players have toggled decals off
- Verify your connection string is correct
- Ensure the database server is running
- Check that the database user has proper permissions
- Verify the command names in the configuration
- Check player permissions in the admin configuration
- Ensure the plugin is loaded (
css_plugins list)
Due to CounterStrikeSharp API limitations, some features have been simplified:
- Decal entity properties (width, height, depth, material) may not be fully customizable through the entity API
- Per-player transmit control is simplified and may show/hide decals for all players
- Entity property configuration is stored in the database but may not affect the visual appearance
These limitations are due to the CS# entity API not exposing all env_decal properties. Future updates to CounterStrikeSharp may allow full property control.
- Original SwiftlyS2 version: CS2-MapDecals-SwiftlyS2
- Ported to CounterStrikeSharp by JonneKahvila
This project is provided as-is for use with Counter-Strike 2 servers.