This post explains about, how you can add cfg (Configuration file) to !admin menu and execute them whenever required.
Step 1: Create your cfg files and put it in cstrike/cfg or cstrike/cfg/sourcemod folder.
Step 2: Open cstrike/addons/sourcemod/config/adminmenu_cfgs.txt file.
Step 3: Add your cfg files path in the adminmenu_cfgs.txt file.
Step 4: Restart server or change map.
Now you can see your cfg listed in !admin menu.
Example :
- Let's say we want to turn on/off awp no scope using !admin menu by executing cfg files.
- Make sure awpns.smx plugin is in cstrike/addons/sourcemod/plugins/disabled folder.
- Create 2 cfg files, awp_noscope_on.cfg and awp_noscope_off.cfg.
awp_noscope_on.cfg
awp_noscope_off.cfg
- Put both cfg files in cstrike/cfg folder.
- Open cstrike/addons/sourcemod/config/adminmenu_cfgs.txt file and add both cfg files inside it.
adminmenu_cfgs.txt
- Restart server or change map.
- Now you can see both the cfg files in !admin menu.
Step 1: Create your cfg files and put it in cstrike/cfg or cstrike/cfg/sourcemod folder.
Step 2: Open cstrike/addons/sourcemod/config/adminmenu_cfgs.txt file.
Step 3: Add your cfg files path in the adminmenu_cfgs.txt file.
Step 4: Restart server or change map.
Now you can see your cfg listed in !admin menu.
Example :
- Let's say we want to turn on/off awp no scope using !admin menu by executing cfg files.
- Make sure awpns.smx plugin is in cstrike/addons/sourcemod/plugins/disabled folder.
- Create 2 cfg files, awp_noscope_on.cfg and awp_noscope_off.cfg.
awp_noscope_on.cfg
Code:
sm plugins load disabled/awpns.smx
say "AWP No Scope Mode is Enabled !!!"
sm_tsay blue "AWP No-Scope Enabled"
Code:
sm plugins unload disabled/awpns.smx
say "AWP No Scope Mode is Disabled!!!"
sm_tsay red "AWP No-Scope Disabled"
- Open cstrike/addons/sourcemod/config/adminmenu_cfgs.txt file and add both cfg files inside it.
adminmenu_cfgs.txt
Code:
/**
* List config files here (relative to moddir) to have them added to the exec config menu list
* Left side is the filename, right side is the text to be added to the menu
*/
Configs
{
"cfg/server.cfg" "Standard Server Setup"
"cfg/awp_noscope_on.cfg" "Enable AWP No Scope"
"cfg/awp_noscope_off.cfg" "Disable AWP No Scope"
}
- Now you can see both the cfg files in !admin menu.