mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-07 02:18:35 +00:00
Fix multiple commands execution in adminmenu_custom.txt
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"
}
}
}
}
```
This commit is contained in:
parent
5e3dc6c6c4
commit
e42a878576
@ -584,14 +584,22 @@ public void ParamCheck(int client)
|
||||
char unquotedCommand[CMD_LENGTH];
|
||||
UnQuoteString(g_command[client], unquotedCommand, sizeof(unquotedCommand), "#@");
|
||||
|
||||
if (outputItem.execute == Execute_Player) // assume 'player' type execute option
|
||||
// Use commands directly without unnecessary unquoting
|
||||
char commands[10][CMD_LENGTH];
|
||||
int count = ExplodeString(g_command[client], ";", commands, sizeof(commands), sizeof(commands[]));
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
FakeClientCommand(client, unquotedCommand);
|
||||
}
|
||||
else // assume 'server' type execute option
|
||||
{
|
||||
InsertServerCommand(unquotedCommand);
|
||||
ServerExecute();
|
||||
TrimString(commands[i]);
|
||||
if (outputItem.execute == Execute_Player) // assume 'player' type execute option
|
||||
{
|
||||
FakeClientCommand(client, commands[i]);
|
||||
}
|
||||
else // assume 'server' type execute option
|
||||
{
|
||||
InsertServerCommand(commands[i]);
|
||||
ServerExecute();
|
||||
}
|
||||
}
|
||||
|
||||
g_command[client][0] = '\0';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user