diff --git a/Assets/Scripts/Chat/Chat2Commands.cs b/Assets/Scripts/Chat/Chat2Commands.cs index 22e0f733..40d1d600 100644 --- a/Assets/Scripts/Chat/Chat2Commands.cs +++ b/Assets/Scripts/Chat/Chat2Commands.cs @@ -41,11 +41,11 @@ namespace SanAndreasUnity.Chat } // send command back to player - ChatManager.SendChatMessageToPlayer(player, chatMessage); + ChatManager.SendChatMessageToPlayer(player, chatMessage, false); // send response back to player if (!string.IsNullOrWhiteSpace(response)) - ChatManager.SendChatMessageToPlayer(player, response); + ChatManager.SendChatMessageToPlayer(player, response, true); // discard chat message return new ChatPreprocessorResult {shouldBeDiscarded = true}; diff --git a/Assets/Scripts/Chat/ChatManager.cs b/Assets/Scripts/Chat/ChatManager.cs index e9481791..46c0a3af 100644 --- a/Assets/Scripts/Chat/ChatManager.cs +++ b/Assets/Scripts/Chat/ChatManager.cs @@ -177,7 +177,7 @@ namespace SanAndreasUnity.Chat } /// Use only on server. - public static void SendChatMessageToPlayer( Player player, string msg ) { + public static void SendChatMessageToPlayer( Player player, string msg, bool useServerNick ) { NetStatus.ThrowIfNotOnServer(); @@ -185,7 +185,7 @@ namespace SanAndreasUnity.Chat if (string.IsNullOrEmpty(msg)) return; - SendChatMessageToPlayer (player, msg, singleton.serverChatNick); + SendChatMessageToPlayer (player, msg, useServerNick ? singleton.serverChatNick : ""); }