Conversation
|
I would probably just change it to private void Chat_OnChatMessage(Player player, string msg)
{
if (!chatMsgOverride && !string.IsNullOrEmpty(msg))
BuildMessage(player, msg);
}Server admins can handle the rest on their server plugin end, for example they could check if msg has a "/" and just call chatPlugin!.chatMsgOverride = true; on their end. The above assumes chatPlugin is the HogWarpChat variable |
I tried this solution but I remember I had some problems of "timing", the chatMsgOverride variable wouldn't be updated in time to prevent the BuildMessage function to be triggered. |
Summary
This will simply prevent the message to be sent if the first letter of the msg is "/"