コード例 #1
0
        private object IOnPlayerChat(PlayerMessageEvent evt)
        {
            // Call game and covalence hooks
            object chatSpecific  = Interface.Call("OnPlayerChat", evt);
            object chatCovalence = Interface.Call("OnUserChat", evt.Player.IPlayer, evt.Message);

            if (chatSpecific != null || chatCovalence != null)
            {
                // Cancel chat message event
                evt.Cancel();
                return(true);
            }

            return(null);
        }
コード例 #2
0
        private object IOnPlayerChat(PlayerMessageEvent evt)
        {
            // Ignore the server player
            if (evt.PlayerId == 9999999999)
            {
                return(null);
            }

            // Call hooks for plugins
            object chatSpecific  = Interface.Call("OnPlayerChat", evt);
            object chatCovalence = Interface.Call("OnUserChat", evt.Player.IPlayer, evt.Message);
            object canChat       = chatSpecific is null ? chatCovalence : chatSpecific;

            if (canChat != null)
            {
                // Cancel chat message event
                evt.Cancel();
                return(true);
            }

            return(null);
        }