## Features
- Custom weapon models menu accessible via `say /models`
- Configurable models for each weapon
- Permission-based model access using admin flags
- Persistent model selection (saves between deaths and map changes)
- Models are applied automatically when picking up weapons
- No requirement to hold the weapon to select its model
- Support for both view (v_) and player (p_) models
- Easy-to-use configuration file
## Commands
- `say /models` - Opens the weapon models menu
- `amx_reloadmodels` - Reloads the weapon models configuration file (admin only)
## Configuration File
The configuration file is located at: `addons/amxmodx/configs/weapon_models.cfg`
### Format
```
[Weapon Name]
classname = weapon_name
model = "v_model_path" "p_model_path" "flags" "model_name"
```
### Example Configuration
```
[AK-47]
classname = weapon_ak47
model = "models/v_ak47.mdl" "models/p_ak47.mdl" "" "Default"
model = "models/custom/v_ak47_dragon.mdl" "models/custom/p_ak47_dragon.mdl" "b" "Dragon AK-47"
[M4A1]
classname = weapon_m4a1
model = "models/v_m4a1.mdl" "models/p_m4a1.mdl" "" "Default"
model = "models/custom/v_m4a1_beast.mdl" "models/custom/p_m4a1_beast.mdl" "a" "Beast M4A1"
```
### Configuration Fields
- `[Weapon Name]` - Display name of the weapon in the menu
- `classname` - Internal weapon classname (e.g., weapon_ak47)
- `model` - Model definition with four parameters:
1. `v_model_path` - Path to the view model (first person view)
2. `p_model_path` - Path to the player model (third person view)
3. `flags` - Admin flags required to use this model (empty for no restrictions)
4. `model_name` - Display name of the model in the selection menu
## Admin Flags
You can restrict access to specific models using admin flags in the configuration file:
- Leave empty (`""`) for no restrictions
- Use standard AMX Mod X flags (e.g., "b" for basic admin, "a" for immunity)
- Multiple flags can be combined (e.g., "abcd")
## Installation
1. Copy `weapons_menu.amxx` to your `addons/amxmodx/plugins/` directory
2. Add `weapons_menu.amxx` to your `plugins.ini` file
3. Add your custom models to the appropriate directories
4. Restart your server or reload plugins
The plugin will automatically create its configuration file (`weapon_models.cfg`) in the `addons/amxmodx/configs/` directory when first loaded. You can then modify this file to add your custom models and settings.
## Model Requirements
- Models must be properly compiled for Counter-Strike
- Both view (v_) and player (p_) models must be provided
- Model paths are relative to the game's `models/` directory
- Models should be precached (done automatically by the plugin)
## Technical Details
The plugin uses:
- AMX Mod X core functionality
- Fakemeta for model manipulation
- ReAPI for enhanced weapon handling
- HamSandwich for weapon deployment hooks
- CromChat for colored messages
## Troubleshooting
1. **Models not showing:**
- Check if model paths are correct
- Verify models are in the correct directory
- Ensure models are properly compiled for CS
2. **Menu not appearing:**
- Check if plugin is loaded (`amxx plugins`)
- Verify syntax in configuration file
- Check server logs for errors
3. **Models not persisting:**
- Plugin creates necessary data structures automatically
- No additional configuration needed
- Models are saved per player per weapon
## Notes
- The configuration file is created automatically if it doesn't exist
- Existing configuration files are never overwritten
- Models are applied immediately if the weapon is held
- Models persist through deaths and map changes
- Invalid models or configurations will be logged to the server console