**Weapon Override** is a powerful utility for CS:GO servers that allows CT players to choose their preferred loadout regardless of their inventory settings. It automatically replaces the **M4A4** with the **M4A1-S** and the **P2000** with the **USP-S** based on player preference.
The plugin works seamlessly on spawn, when buying from the shop, or even when picking up a weapon from the ground.
---
## ✨ Features
- 🔄 **Automatic Swap** — Instantly replaces M4A4/P2000 with silencer versions.
- 💾 **Persistent Settings** — Choices are saved in a database (SQLite/MySQL) and restored on reconnect.
- 🛠️ **Interactive Menu** — Easy-to-use menu for toggling overrides.
- ⚡ **Force Apply** — "Apply now" option to swap currently held weapons mid-round (as CT).
- 💡 **Smart Hints** — Reminds players about the override feature if they are using default weapons at round start.
- 🔌 **Late-Load Support** — Hooks players immediately if the plugin is loaded during a match.
---
## 📦 Installation
1. Copy `weapon_override.smx` to:
```
csgo/addons/sourcemod/plugins/
```
2. (Optional) Configure your database in `addons/sourcemod/configs/databases.cfg`. By default, it uses the `storage-local` entry.
3. Load the plugin:
```
sm plugins load weapon_override
```
---
## ⚙️ Configuration
### CVars
The plugin uses the following CVar to determine which database entry to use:
- `sm_override_db` (Default: `storage-local`) — The named connection in your `databases.cfg`.
### Database Table
The plugin automatically creates a table named `weapon_override` with the following structure:
- `steamid` (Primary Key)
- `rifle` (0/1)
- `pistol` (0/1)
---
## 🛠️ Commands
| Command | Description |
|---|---|
| `!override` / `/override` | Opens the weapon override settings menu |
| `!weapons` / `/weapons` | Opens the weapon override settings menu |
| `sm_override` | Console command to open the menu |
| `sm_weapons` | Console command to open the menu |
---
## 🎮 Menu Options
1. **Override M4A1-S** — Toggle between `[ON]` (M4A4 → M4A1-S) and `[OFF]` (Keep M4A4).
2. **Override USP-S** — Toggle between `[ON]` (P2000 → USP-S) and `[OFF]` (Keep P2000).
3. **Apply now** — Swaps your current weapons if you are alive and in the CT team.