Team Swap Plugin
Version: 1.0
Author: illusionLabs.dev
Game: Counter-Strike 1.6
📋 Description
Team Swap is a Counter-Strike 1.6 plugin that allows players to exchange teams (Terrorists ↔ Counter-Terrorists) through mutual consent. The plugin includes a request system, cooldown timer, and full administrative control.
✨ Features
🎮 For Players
- Team swap requests - Send requests to players from the opposing team
- Interactive menu - Color-coded menu for player selection
- Confirmation system - Target player must accept the request
- Cooldown system - Prevents spam and abuse
- Visual indicators - Colored messages and team indicators
👮 For Administrators
- Force swap - Command to directly swap teams between two players
- Bypass privileges - Bypass cooldown and dead player requirements
- Configurable flag - Set required admin flag
- Logging - All admin actions are logged
🎯 Commands
Players
Command Description
say /swapOpens menu to select a player for team swap
say_team /swapSame as above, but in team chat
Administrators
Command Description Flag
amx_swap <player1> <player2>Force swap teams of two playersADMIN_LEVEL_A
⚙️ Cvars (Configuration)
All settings are managed through cvars and can be changed in real-time:
Main Settings
// Enable/disable the pluginteamswap_enabled "1"// 0 = disabled// 1 = enabled (default)
// Cooldown timer in secondsteamswap_cooldown "300"// Default: 300 seconds (5 minutes)// Can be changed to any value
// Require players to be deadteamswap_require_dead "1"// 0 = alive players can swap teams// 1 = players must be dead (default)
// Show public messagesteamswap_show_messages "1"// 0 = hide team swap messages// 1 = show public messages (default)
Customization Settings
// Chat and menu prefixteamswap_prefix "[Team Swap]"// Default: "[Team Swap]"// Can be changed to any text, e.g., "[TS]", "[Swap]", "Team Swap"// This prefix appears in all chat messages and menu titles
Admin Settings
// Admin flag for bypass privilegesteamswap_admin_flag "b"// Default: "b" (reservation)// Can be changed to: "a", "c", "d", etc.
// Admins bypass cooldownteamswap_admin_bypass_cooldown "1"// 0 = admins follow cooldown rules// 1 = admins bypass cooldown (default)
// Admins bypass dead player requirementteamswap_admin_bypass_dead "1"// 0 = admins must be dead// 1 = admins can swap while alive (default)
📦 Installation
Requirements
- AMX Mod X 1.8.2 or newer
- Counter-Strike 1.6
Dependencies
#include <amxmodx>#include <amxmisc>#include <cstrike>
Installation Steps
- Compile the plugin:
- Place
TeamSwap.sma in addons/amxmodx/scripting/ - Compile with
amxxpc TeamSwap.sma - Install the .amxx file:
- Copy
TeamSwap.amxx to addons/amxmodx/plugins/ - Activate the plugin:
- Add
TeamSwap.amxx to addons/amxmodx/configs/plugins.ini - Configure settings:
- Add cvars to
addons/amxmodx/configs/amxx.cfg or create a separate config file - Restart the server or change the map
🎨 How It Works
For Players
- Starting a request:
- Player types
/swap in chat - A menu opens with players from the opposing team
- Players are color-coded: 🔴 Terrorists, 🔵 Counter-Terrorists
- Selecting a player:
- Player selects who they want to swap teams with
- Request is sent to the selected player
- Cooldown timer is activated
- Confirmation:
- Target player receives a menu with "Yes" / "No" options
- On "Yes" - teams are swapped immediately
- On "No" - request is declined
- Cooldown:
- After sending a request, cooldown is activated
- Player sees remaining time in
MM:SS format - Cooldown applies to both players after successful swap
For Administrators
- Force swap:
amx_swap "Player1" "Player2"
- Directly swaps teams without confirmation
- No cooldown applied
- Action is logged
- Bypass privileges:
- Admins can bypass cooldown (if enabled)
- Admins can swap teams while alive (if enabled)
- Flag is determined by
teamswap_admin_flag
🔒 Restrictions and Checks
Automatic Checks
- ✅ Player is not spectator or unassigned
- ✅ Player is dead (if required)
- ✅ Target player is from opposing team
- ✅ Cooldown timer has expired
- ✅ Both players are connected during swap
- ✅ Plugin is enabled
Error Messages
The plugin displays clear messages when:
- Attempting to use while disabled
- Attempting to use as spectator
- Attempting to use while alive (if required)
- No available players to swap with
- Active cooldown timer
- Invalid request or disconnected player
🐛 Troubleshooting
Plugin not working
- Check if it's added to
plugins.ini - Check if
teamswap_enabled is "1" - Check console for loading errors
Players cannot swap teams
- Check
teamswap_require_dead - may require players to be dead - Check cooldown timer - may not have expired
- Check if there are players from opposing team
Admins don't have bypass
- Check
teamswap_admin_flag - must match admin's flag - Check
teamswap_admin_bypass_cooldown and teamswap_admin_bypass_dead - Check
users.ini for correct flags
Cooldown not working properly
- Cooldown activates when sending the request, not during swap
- Both players receive cooldown after successful swap
- Admins can bypass cooldown (if enabled)
📝 Logs
The plugin logs the following actions in AMX logs:
Admin [Name] <SteamID> swapped teams of [Player1] and [Player2]
Logs are located in: addons/amxmodx/logs/
🔄 Changelog
Version 1.0
- ✅ Core team swap functionality
- ✅ Request system with confirmation
- ✅ Cooldown timer
- ✅ Interactive menus
- ✅ Admin command for force swap
- ✅ Full cvar configuration
- ✅ Admin bypass system
- ✅ Configurable admin flag
- ✅ Customizable prefix for chat and menus
- ✅ Colored messages and indicators
📞 Support
For questions, issues, or suggestions:
- Author: illusionLabs.dev / illusion
- Plugin: Team Swap v1.0
📄 License
This plugin was created by illusionLabs.dev / eSportsDesigns.com for Counter-Strike 1.6 servers.
🎉 Credits
Thanks to everyone who uses and tests this plugin!
Enjoy the game! 🎮