AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [ANY] Command Shortcuts (https://forums.alliedmods.net/showthread.php?t=331449)

stephen473 03-21-2021 20:21

[ANY] Command Shortcuts
 
4 Attachment(s)
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


Installation
  • Upload commandshortcuts.cfg to addons/sourcemod/configs/ folder
  • Upload sm_commandshortcuts.smx to addons/sourcemod/plugins folder

NanoC 03-22-2021 00:01

Re: [ANY] Command Shortcuts
 
Nicely done!

stephen473 03-22-2021 04:32

Re: [ANY] Command Shortcuts
 
Quote:

Originally Posted by NanoC (Post 2741246)
Nicely done!

thank you!

any suggestion & feature request will be welcomed.

Tonblader 03-22-2021 04:58

Re: [ANY] Command Shortcuts
 
these shortcuts can be executed in chat or console or can they be in both?
I would like it to be possible in both

stephen473 03-22-2021 09:19

Re: [ANY] Command Shortcuts
 
Quote:

Originally Posted by Tonblader (Post 2741268)
these shortcuts can be executed in chat or console or can they be in both?
I would like it to be possible in both

currently shortcuts only works as chat triggers. so it won't work on console. but i will add that option asap.

stephen473 03-22-2021 10:29

Re: [ANY] Command Shortcuts
 
updated!

new version 1.1
Added option to register shortcuts as a console command. Requested by Tonblader

see main post to download the latest version.

Tonblader 03-22-2021 15:13

Re: [ANY] Command Shortcuts
 
Quote:

Originally Posted by stephen473 (Post 2741299)
updated!

new version 1.1
Added option to register shortcuts as a console command. Requested by Tonblader

see main post to download the latest version.

Thanks, is necesarry use "sm_" to execute or only the "shortcut command"?

Similar to this:
https://wiki.alliedmods.net/Commands...#Chat_Triggers

stephen473 03-23-2021 04:04

Re: [ANY] Command Shortcuts
 
Quote:

Originally Posted by Tonblader (Post 2741341)
Thanks, is necesarry use "sm_" to execute or only the "shortcut command"?

Similar to this:
https://wiki.alliedmods.net/Commands...#Chat_Triggers


no. you can register the command however you want. but even if you just register command as "fly" you need to use those chat triggers(!fly / /fly) to use it in chat. in console you can just type fly.

ThatKidWhoGames 03-23-2021 07:06

Re: [ANY] Command Shortcuts
 
Beat me to it, nicely done! :)

stephen473 03-23-2021 14:26

Re: [ANY] Command Shortcuts
 
thank you for your precious comment :)


All times are GMT -4. The time now is 08:33.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.