Command Shortcuts
Description:
Allows players/admins to execute server/client commands via shortcuts. There is a plugin does almost the same by Arkarr but it is outdated. Some people asked for an update so i rewrited a new one.
Version:
1.0 - First release.
1.1 - Added option to register shortcuts as a console command. Requested by
Tonblader
1.2 - Added option to use a specified STEAMID instead of admin flag. Requested by
starcs
1.3 - Added function to apply commands delayed in specificied second(s). Requested by
Alessandro_k
Features:- Any keyword can be a shortcut to an existing command.
- Allows client commands to execute via shortcuts.
- Shortcuts can be specified for admin flag.
- Real commands can be triggered in delayed after shortcut has triggered.
Console Variables:
Config file is located in: cfg/sourcemod/sm_commandshortcuts.cfg
- sm_commandshortcuts_notification - Display a message when a command shortcut triggered. 1 = Enabled, 0 = Disabled
- sm_commandshortcuts_publicinfo - Allow all clients to lookup command shortcuts info by typing !commandshortcuts. 1 = All Clients, 0 = Only Admins(who have access to ban)
Commands:- sm_reloadshortcuts - Reloads the config file.
- sm_commandshortcuts - Gives info about command shortcuts.
Configuration
"shortcut" - Trigger to execute the command.
"flag" - Needed flag to use trigger. Instead of flag, a steamid can also be used. Only specified STEAMID will be able to use trigger. Leaving it completely empty means no permission required.
"command" - Command to execute when shortcut triggered. {player} can be used to target the client who triggered the shortcut. It's the same as @me.
"type" - Type of command. Set 1 if the command needed to be executed by console, or set 2 to execute by client.
"registershortcut" Registers the shortcut if the option is 1. With that shortcut can be used on console. Set 0 if you want shortcut works only as a chat trigger.
"delay" - Delay you want command to execute. Set to 0 if it's not needed.
The section names(1, 2, 3) is not important but must be unique.
See the example for full info.
Example:
Spoiler
PHP Code:
"commandshortcuts"
{
"1"
{
"shortcut" "!restartgame"
"flag" "d"
"command" "mp_restartgame 5"
"type" "1"
"registershortcut" "0"
"delay" "1"
}
"2"
{
"shortcut" "sm_fly"
"flag" "STEAM_0:1:175038461"
"command" "sm_noclip {player}"
"type" "1"
"registershortcut" "1"
"delay" "2"
}
"3"
{
"shortcut" "!shortcuts"
"flag" ""
"command" "sm_commandshortcuts"
"type" "2"
"registershortcut" "0"
"delay" "0"
}
}
Installation- Upload commandshortcuts.cfg to addons/sourcemod/configs/ folder
- Upload sm_commandshortcuts.smx to addons/sourcemod/plugins folder