Quote:
Originally Posted by SmokieCS
|
https://github.com/ksgoescoding/Paus...ePlugin.sp#L33
Code:
RegConsoleCmd("sm_pause", Command_Pause, "Requests a pause");
https://github.com/ksgoescoding/Paus...ePlugin.sp#L51
Code:
AddAliasedCommand("pause", Command_Pause, "Pauses the game");
https://github.com/ksgoescoding/Paus...n.sp#L153-L163
Code:
/** Add Aliased Command callback **/
public void AddAliasedCommand(const char[] command, ConCmd callback, const char[] description) {
char smCommandBuffer[COMMAND_LENGTH];
Format(smCommandBuffer, sizeof(smCommandBuffer), "sm_%s", command);
RegConsoleCmd(smCommandBuffer, callback, description);
char dotCommandBuffer[ALIAS_LENGTH];
Format(dotCommandBuffer, sizeof(dotCommandBuffer), ".%s", command);
AddChatAlias(dotCommandBuffer, smCommandBuffer);
}
*edit
When someone want add more "
chat triggers" for one specific command callback, I would recommend to use some kind custom KeyValue file rather than
hard code lot of reg console commands or check say command arguments in plugin code.
With custom KeyValue txt file:
- User, who want use plugin, can modified or remove these unnecessary thing in they own server.
- Not need edit plugin code and recompile
- Not need look every console commands for override them from admin configures.
This is just my opinion.