From 5001fc8b8f031d03e3adaca4cac82f16524e0a0e Mon Sep 17 00:00:00 2001 From: Resxt <55228336+Resxt@users.noreply.github.com> Date: Sun, 18 Jun 2023 15:39:41 +0200 Subject: [PATCH] chat_commands 1.1.1 Fix commands not working on dedicated servers The newly added ExecuteCommand function already exists (on dedicated servers only) and therefore it was always called the game's function instead of the chat commands function. Simply renaming them to a more specific name fixed the issue --- chat_commands/chat_commands.gsc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/chat_commands/chat_commands.gsc b/chat_commands/chat_commands.gsc index 74f4f43..acb40f8 100644 --- a/chat_commands/chat_commands.gsc +++ b/chat_commands/chat_commands.gsc @@ -112,7 +112,7 @@ CreateCommand(serverPorts, commandName, commandType, commandValue, commandMinimu } } -ExecuteCommand(command, args, player) +ExecuteChatCommand(command, args, player) { if (command["type"] == "text") { @@ -129,11 +129,11 @@ ExecuteCommand(command, args, player) } } -TryExecuteCommand(commandValue, commandName, args, player) +TryExecuteChatCommand(commandValue, commandName, args, player) { if (!PermissionIsEnabled() || PlayerHasSufficientPermissions(player, commandValue["permission"])) { - ExecuteCommand(commandValue, args, player); + ExecuteChatCommand(commandValue, args, player); } else { @@ -359,7 +359,7 @@ ChatListener() if (IsDefined(commandValue)) // try to find the command by its original name { - TryExecuteCommand(commandValue, inputCommandName, args, player); + TryExecuteChatCommand(commandValue, inputCommandName, args, player); } else // try to find the command by one of its aliases { @@ -371,7 +371,7 @@ ChatListener() } else { - TryExecuteCommand(level.commands[GetDvar("net_port")][originalCommandName], inputCommandName, args, player); + TryExecuteChatCommand(level.commands[GetDvar("net_port")][originalCommandName], inputCommandName, args, player); } } }