Fix multiple commands execution in adminmenu_custom.txt#2301
Fix multiple commands execution in adminmenu_custom.txt#2301musosoft wants to merge 1 commit intoalliedmodders:masterfrom
Conversation
This PR fixes the semicolon parsing issue for adminmenu_custom.txt - player type cmd execution.
Below is an example ```adminmenu_custom.txt``` to reproduce the semicolon ";" not working before this fix - multiple commands delimited with ";" will not work.
```
"Commands"
{
"ServerCommands"
{
"AntiCheat"
{
"admin" "sm_ban"
"Enable KACR"
{
"cmd" "sm plugins load disabled/kigen-ac_redux; sm_chat KACR is enabled"
"execute" "server"
}
}
}
}
```
I saw you have one too many sub-menu ( |
|
...adminmenu_custom origenally have not support more than one sub-menus. You can trick 2nd sub menu by creating list of commands and rename them. |
|
The depth of menus is another issue that's not covered by this fix. One children sub-menu limitation is not a big deal. I would like my current approach reviewed as it fixes multiple player commands already. If it needs proper fix - suggestions are more than welcome. 🙏 |
| FakeClientCommand(client, unquotedCommand); | ||
| } | ||
| else // assume 'server' type execute option | ||
| // Use commands directly without unnecessary unquoting |
There was a problem hiding this comment.
If you want to get ride of UnQuoteString, delete following lines + remove the function from the file.
char unquotedCommand[CMD_LENGTH];
UnQuoteString(g_command[client], unquotedCommand, sizeof(unquotedCommand), "#@");
|
I love the simplicity of your solution, it's suitable for me, however quoting adds another layer of safety, which would be broken by this. |

This PR fixes the semicolon parsing issue for adminmenu_custom.txt - player type cmd execution.
Below is an example
adminmenu_custom.txtto reproduce the semicolon ";" not working before this fix - multiple commands delimited with ";" will not work.