Пример #1
0
        public void OnEvent(ShPlayer player, string message)
        {
            if (chatted.Limit(player))
            {
                return;
            }

            if (player.GetExtendedPlayer().Muted)
            {
                player.TS("muted_player");
                return;
            }

            if (CommandHandler.OnEvent(player, message)) // 'true' if message starts with command prefix
            {
                return;
            }

            Core.Instance.Logger.LogInfo($"[GLOBAL] {player.username}: {message}");

            switch (player.GetExtendedPlayer().CurrentChat)
            {
            case Chat.StaffChat:
                ChatUtils.SendStaffChatMessage(player, message);
                return;

            case Chat.Disabled:
                player.TS("chat_disabled");
                return;

            default:
                ChatUtils.SendToAllEnabledChat(ChatUtils.FormatMessage(player, message), false);
                return;
            }
        }
Пример #2
0
        public void OnEvent(ShPlayer player, string message)
        {
            if (message.StartsWith(CommandHandler.Prefix))
            {
                return;
            }
            Core.Instance.Logger.LogInfo($"[GLOBAL] {player.username}: {message}");
            switch (player.GetExtendedPlayer().CurrentChat)
            {
            case Chat.StaffChat:
                ChatUtils.SendStaffChatMessage(player, message);
                return;

            case Chat.Disabled:
                player.TS("chat_disabled");
                return;

            default:
                ChatUtils.SendToAllEnabledChat(ChatUtils.FormatMessage(player, message), false);
                return;
            }
        }