diff --git a/src/RustHooks.cs b/src/RustHooks.cs index c8121515c..06e881043 100644 --- a/src/RustHooks.cs +++ b/src/RustHooks.cs @@ -290,7 +290,7 @@ private object IOnPlayerChat(ulong playerId, string playerName, string message, string chatCommandPrefix = CommandHandler.GetChatCommandPrefix(message); if ( chatCommandPrefix != null ) { - TryRunPlayerCommand( basePlayer, message.Substring( chatCommandPrefix.Length ) ); + TryRunPlayerCommand( basePlayer, message, chatCommandPrefix ); return false; } @@ -315,7 +315,7 @@ private object IOnPlayerChat(ulong playerId, string playerName, string message, /// /// /// - private void TryRunPlayerCommand(BasePlayer basePlayer, string message) + private void TryRunPlayerCommand(BasePlayer basePlayer, string message, string commandPrefix) { if (basePlayer == null) { @@ -331,7 +331,7 @@ private void TryRunPlayerCommand(BasePlayer basePlayer, string message) } // Parse the command - ParseCommand(str, out string cmd, out string[] args); + ParseCommand(str.Substring(commandPrefix.Length), out string cmd, out string[] args); if (cmd == null) { return;