Menu
 

CS2 SourceMod & MetaMod Guide 2025 - Plugin System Setup

CS2 SourceMod & MetaMod Guide 2025

SourceMod and MetaMod:Source are the premier plugin frameworks for CS2 servers, enabling extensive customization through community plugins. This guide covers installation, configuration, and management for creating custom game modes and server enhancements.

📋 Plugin Framework Overview

  • MetaMod:Source: Plugin loader and manager for Source engine games
  • SourceMod: Scripting platform built on MetaMod with extensive API
  • CS2 Support: Experimental/beta support as of 2025
  • Plugin Ecosystem: Thousands of plugins from CS:GO era being adapted
  • Performance: Minimal overhead with proper configuration

Installation Guide

Prerequisites

  1. CS2 Dedicated Server installed and working
  2. SteamCMD updated to latest version
  3. Admin access to server files and configuration
  4. Windows: Visual C++ Redistributables 2015-2022
  5. Linux: Standard build tools (gcc, make, etc.)

Step-by-Step Installation

1. Install MetaMod:Source

# Download latest MetaMod:Source
# Windows: https://www.sourcemm.net/downloads.php?branch=stable
# Linux: https://www.sourcemm.net/downloads.php?branch=stable-linux

# Extract to CS2 server directory
# Structure should be:
/cs2/server/
├── game/
│   ├── csgo/
│   │   ├── addons/
│   │   │   ├── metamod/           # MetaMod files
│   │   │   │   ├── metamod.vdf    # Loader file
│   │   │   │   └── bin/           # Binary files
│   │   │   └── cfg/               # Configuration files

# Verify installation
# Add to launch parameters: -insecure +meta version

2. Install SourceMod

# Download latest SourceMod
# Windows: https://www.sourcemod.net/downloads.php?branch=stable
# Linux: https://www.sourcemod.net/downloads.php?branch=stable-linux

# Extract to CS2 server directory
# Structure should be:
/cs2/server/
├── game/
│   ├── csgo/
│   │   ├── addons/
│   │   │   ├── sourcemod/         # SourceMod files
│   │   │   │   ├── extensions/    # Optional extensions
│   │   │   │   ├── plugins/       # Plugin files (.smx)
│   │   │   │   ├── scripting/     # Source code (.sp)
│   │   │   │   └── configs/       # Configuration files
│   │   │   └── metamod/           # Already installed

# Verify installation
# In game console: meta list
# Should show: [01] SourceMod (1.11.0.xxxx) by AlliedModders LLC

3. Configure GameInfo

# Edit /cs2/server/game/csgo/gameinfo.gi
# Add after first "Game" section:

Game csgo
{
	ToolsDirectory		"..\..\bin"
	
	// Addons section for MetaMod
	Addons
	{
		"addons/metamod/bin/win64"	"."
	}
	
	// Search paths
	SearchPaths
	{
		Game				csgo
		Game				csgo/addons/metamod
		Game				csgo/addons/sourcemod
		Mod					csgo
		Write				csgo
	}
}

Verification and Testing

Launch Parameters

# Add to server launch command
./cs2 -dedicated +map de_dust2 -insecure +meta version +sm version

# Key parameters:
# -insecure          Allows MetaMod loading (disables VAC)
# +meta version      Shows MetaMod version
# +sm version        Shows SourceMod version

# For production (with VAC):
# Remove -insecure but ensure plugins are VAC-safe

Verification Commands

# In server console or RCON:
meta version          # Show MetaMod version
meta list             # List loaded plugins
sm version            # Show SourceMod version
sm plugins list       # List loaded SourceMod plugins
sm exts list          # List loaded extensions
sm test               # Test SourceMod functionality

# Expected output example:
[META] MetaMod:Source v1.11.0.xxxx
[META] Loaded 1 plugin:
        [01] SourceMod (1.11.0.xxxx)

Plugin Management

Finding and Installing Plugins

🌐 Official Sources

  • AlliedModders: forums.alliedmods.net - Official plugin repository
  • GitHub: Community-developed plugins
  • GameBanana: CS2 specific plugins and mods
  • SourceMod Plugins: www.sourcemod.net/plugins.php

📥 Installation Methods

  • Manual: Download .smx to addons/sourcemod/plugins/
  • Auto: Use SourceMod Updater (SMU) extension
  • Compiled: Compile .sp files from scripting/ folder
  • Collections: Plugin packs for common server types

🔧 Update Management

  • SM Updater: Automatic plugin updates
  • Manual updates: Replace .smx files
  • Compilation: Update .sp source files
  • Version checking: sm plugins list shows versions

Essential Plugin Categories for CS2

Administration Plugins

PluginDescriptionConfiguration File
Admin CommandsEnhanced admin command systemadmin_overrides.cfg
SourceBans / SourceBans++Advanced banning systemsourcebans.cfg
Admin MenuGUI admin menu interfaceadminmenu.cfg
Player ManagementKick, ban, mute, gag managementbasecommands.cfg

Gameplay Enhancement

PluginDescriptionKey Features
Weapon RestrictControl weapon availabilityPer-map, per-team restrictions
DeathmatchFFA deathmatch game modeSpawn weapons, respawn timers
RetakesRetake game modeAutomatic site selection, economy
ExecutesExecute practice modePre-set executes, smokes, flashes
Knife OnlyKnife fight modeAutomatic knife distribution

Server Management

PluginDescriptionPerformance Impact
MapChooser / NominationsVoting for next mapLow
Rock The VoteVote to change mapVery Low
Server AdvertisementDisplay server messagesLow
HLstatsX:CEPlayer statistics trackingMedium (database)
Discord / Web IntegrationConnect to external servicesLow-Medium

Configuration

SourceMod Core Configuration

// addons/sourcemod/configs/core.cfg
// Basic configuration

"Core"
{
	// General settings
	"AdminConfig"			"admins_simple.ini"
	"AdmFlagOverrides"		"overrides.cfg"
	
	// Database configuration
	"Databases"
	{
		"default"
		{
			"driver"		"sqlite"
			"database"		"sourcemod-local"
		}
		"storage-local"
		{
			"driver"		"sqlite"
			"database"		"sourcemod"
		}
	}
	
	// Logging
	"Logging"
	{
		"Enabled"		"1"
		"Dir"			"logs"
		"Rotate"		"1"
		"MaxFiles"		"30"
	}
	
	// Language
	"Languages"
	{
		"en"			"English"
		"pl"			"Polish"
		"de"			"German"
		"fr"			"French"
	}
}

Admin System Configuration

// addons/sourcemod/configs/admins_simple.ini
// Admin definitions

// Group definitions
"Groups"
{
	"Full Admins"
	{
		"flags"		"abcdefghijklmnopqrstu"
		"immunity"	"99"
	}
	"Moderators"
	{
		"flags"		"abcefgijkmnopqst"
		"immunity"	"50"
	}
}

// User definitions
"Admins"
{
	"STEAM_1:0:12345678"	// Example SteamID
	{
		"identity"		"STEAM_1:0:12345678"
		"group"			"Full Admins"
		"name"			"Server Owner"
	}
	
	"@discord:123456789012345678"	// Discord ID
	{
		"identity"		"@discord:123456789012345678"
		"group"			"Moderators"
		"name"			"Discord Admin"
	}
}

Plugin Configuration Files

  1. addons/sourcemod/configs/ - Main configuration directory
  2. pluginname.cfg - Auto-generated on first plugin load
  3. sourcemod.cfg - Core SourceMod settings (executed on map start)
  4. databases.cfg - Database connection settings
  5. admins_simple.ini - Admin definitions (simplified format)
  6. admin_overrides.cfg - Command permission overrides

Performance Optimization

Plugin Performance Guidelines

MetricAcceptable RangeWarning SignsOptimization
Plugin Count15-30 plugins50+ pluginsDisable unused plugins
Timer UsageMinimal repeating timersMany <0.1s timersCombine timers, increase intervals
Memory Usage< 200MB total> 500MB plugin memoryMonitor with sm_meminfo
Database QueriesAsync, optimizedSynchronous in callbacksUse SQL_TQuery or transactions
Hook UsageEssential events onlyHook all player movementsUse HookEventEx with filters

Monitoring Commands

# Performance monitoring commands
sm_meminfo              # Show memory usage by plugins
sm_plugins list         # List plugins with load order
sm prof                 # Plugin performance profiler
sm_cvar                 # List and modify CVars
sm exts list            # List extensions with versions
sm stats                # Server statistics

# Timer profiling example
sm prof start           # Start profiling
# ... perform server actions
sm prof stop            # Stop and display results

# Memory usage example
[SM] Memory usage:
  Plugin               Files  Memory
  adminmenu.smx        15     45.2 KB
  basecommands.smx     8      12.1 KB
  mapchooser.smx       6      18.7 KB
  Total:               87     176.0 KB

Optimization Configuration

// addons/sourcemod/configs/performance.cfg
// Performance tuning settings

// Timer optimization
sm_cvar sm_timer_limit 1000          // Max concurrent timers
sm_cvar sm_timer_freq 0.1            // Timer processing frequency

// Memory management  
sm_cvar sm_heap_limit 256            // MB heap limit
sm_cvar sm_strings_max 10000         // Max cached strings

// Database optimization
sm_cvar sm_db_connections 10         // Max database connections
sm_cvar sm_db_timeout 30             // Query timeout seconds

// Plugin loading
sm_cvar sm_plugin_load_time 30       // Plugin load timeout
sm_cvar sm_extension_load_time 30    // Extension load timeout

// Logging optimization
sm_cvar sm_log_detail 0              // 0=Minimal, 3=Verbose
sm_cvar sm_log_mode 1                // 1=Rotating files

Popular Server Setups

Competitive / Matchmaking Server

Essential plugins for competitive servers:
1. PugSetup / Scrim plugin - PUG match system
2. Gotv Relay / Demo Manager - Match recording
3. Team Balancer - Auto team balancing
4. Knife Round - Official knife round
5. Warmup Weapon Spawner - Practice during warmup
6. Bomb Plant/Defuse Sounds - Audio cues
7. Round Restorer - Restore rounds after crash
8. Stats Tracking - Player performance stats
9. Veto System - Map veto for matches
10. Ready System - Player ready check

Deathmatch / Casual Server

Essential plugins for DM servers:
1. Deathmatch Core - Spawn weapons, respawn
2. Spawn Protection - Brief invulnerability
3. Killstreak Rewards - Rewards for streaks
4. Weapon Stats - Personal weapon statistics
5. Headshot Only - Game mode modifier
6. Team Deathmatch - Team-based DM
7. Gun Game - Progressive weapons
8. FFA Ladder - Free-for-all rankings
9. Custom Spawns - Configure spawn points
10. Music Kits - Custom round-end music

Retake / Execute Server

Essential plugins for retake servers:
1. Retakes Core - Automatic site selection
2. Execute Mode - Pre-set executes
3. Grenade Practice - Grenade training
4. Site Helper - Visual site indicators
5. Economy Manager - Custom economy
6. Spawn Protection - Protect during setup
7. Round Timer Control - Adjust timers
8. Player Queue - Manage player slots
9. Statistics - Retake success rates
10. Map Specific Configs - Per-map settings

Troubleshooting Common Issues

Plugins not loading after CS2 update

Check MetaMod and SourceMod compatibility with current CS2 version. Update to latest development builds. Check gameinfo.gi configuration. Verify -insecure launch parameter.

"Failed to load plugin" errors

Check plugin compatibility with CS2/SourceMod version. Verify .smx file is compiled for correct SourceMod version. Check dependencies and extensions. Review addons/sourcemod/logs/ error logs.

Server crashes with plugins enabled

Identify crashing plugin by disabling plugins incrementally. Check for plugin conflicts. Update all plugins to latest versions. Verify memory limits and server resources.

Admin commands not working

Verify admin configuration in admins_simple.ini. Check group permissions and immunity levels. Ensure admin_overrides.cfg has correct command permissions. Test with rcon sm_who command.

Poor server performance with plugins

Use sm_meminfo to identify memory-heavy plugins. Reduce plugin count. Optimize timer frequencies. Disable unnecessary hooks. Consider dedicated server with more resources.

Database connection errors

Verify databases.cfg configuration. Ensure database server is accessible. Check firewall rules. Test with sm_dbc test command. Consider SQLite for smaller servers.

Advanced Configuration

SourceMod Extension Management

// Extensions provide additional functionality
// Common extensions for CS2:

1. Socket (socket.ext) - Network communication
2. Regex (regex.ext) - Regular expression support
3. GeoIP (geoip.ext) - Geographic IP location
4. SteamWorks (steamworks.ext) - Steam API integration
5. Discord (discord.ext) - Discord bot integration
6. MySQL/SQLite (dbi.mysql/dbi.sqlite) - Database drivers

// Installation:
// Download .ext.so (Linux) or .ext.dll (Windows)
// Place in addons/sourcemod/extensions/
// Add to addons/sourcemod/extensions/extensions.cfg:
"Extension"
{
	"file"	"extension_name.ext"
	"autoload"	"1"
}

Custom Plugin Development

// Basic plugin template for CS2
#include <sourcemod>
#include <sdktools>

#pragma semicolon 1
#pragma newdecls required

#define PLUGIN_VERSION "1.0.0"

public Plugin myinfo = 
{
	name = "CS2 Example Plugin",
	author = "Your Name",
	description = "Example plugin for CS2",
	version = PLUGIN_VERSION,
	url = "https://example.com"
};

public void OnPluginStart()
{
	RegConsoleCmd("sm_test", Command_Test, "Test command");
	HookEvent("player_death", Event_PlayerDeath);
	
	PrintToServer("[CS2] Example plugin loaded!");
}

public Action Command_Test(int client, int args)
{
	ReplyToCommand(client, "Test command executed!");
	return Plugin_Handled;
}

public void Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast)
{
	int victim = GetClientOfUserId(event.GetInt("userid"));
	int attacker = GetClientOfUserId(event.GetInt("attacker"));
	
	if (IsValidClient(attacker) && IsValidClient(victim) && attacker != victim)
	{
		PrintToChatAll("%N killed %N!", attacker, victim);
	}
}

bool IsValidClient(int client)
{
	return (client > 0 && client <= MaxClients && IsClientInGame(client));
}

VAC and Security Considerations

// CS2 with -insecure flag disables VAC
// For production servers:

1. Use only trusted, verified plugins
2. Regular security audits of plugin code
3. Keep SourceMod and plugins updated
4. Use admin system with strong passwords
5. Monitor for suspicious plugin behavior
6. Regular backups of configurations
7. Isolate server from other services
8. Use firewall to restrict RCON access

// Recommended security plugins:
1. SourceBans++ - Advanced banning with appeal system
2. Anti-Cheat plugins (SAC, etc.)
3. Connection filtering by country
4. VPN/Proxy detection
5. Rate limiting for commands

Best Practices

Plugin Management

  1. Start minimal: Begin with essential plugins, add gradually
  2. Regular updates: Update SourceMod, MetaMod, and plugins monthly
  3. Backup configurations: Backup addons/sourcemod/configs/ weekly
  4. Test changes: Use test server for plugin updates and changes
  5. Documentation: Maintain plugin list with configuration notes

Performance Optimization

  1. Monitor regularly: Use sm_meminfo and sm prof weekly
  2. Limit plugins: Disable unused plugins instead of just unloading
  3. Optimize timers: Use longer intervals where possible
  4. Database optimization: Use indexes, connection pooling
  5. Memory management: Monitor for memory leaks in plugins

Security Practices

  1. Source verification: Only use plugins from trusted sources
  2. Regular audits: Review admin permissions monthly
  3. Access control: Restrict RCON and FTP access
  4. Monitoring: Log all admin actions and suspicious events
  5. Updates: Prompt security updates for SourceMod/MetaMod

Migration from CS:GO to CS2

Key Differences and Considerations

  1. Binary compatibility: CS:GO plugins generally need recompilation
  2. API changes: Some SourceMod natives may differ or be unavailable
  3. Game events: CS2 has different event names and parameters
  4. File structure: Different directory layout in CS2
  5. Performance: CS2 may have different performance characteristics

Migration Checklist

  1. Backup CS:GO server configuration and plugins
  2. Install fresh CS2 server with MetaMod/SourceMod
  3. Test essential plugins for compatibility
  4. Update plugin configurations for CS2 differences
  5. Gradually migrate player data and statistics
  6. Monitor performance and stability
  7. Update server documentation and procedures

Next Steps

Managed CS2 Server Hosting: Supercraft provides optimized CS2 servers with pre-configured SourceMod/MetaMod, automatic plugin updates, and expert support for competitive matchmaking, retake, and community servers.

Top