コード例 #1
0
        public static void InvokeConsoleCommand(GameObject player, string command, bool isEncrypted, out string returnMessage, out string color)
        {
            if (ConsoleCommandEvent == null)
            {
                returnMessage = "Command not found.";
                color         = "red";
                return;
            }

            ConsoleCommandEvent ev = new ConsoleCommandEvent(isEncrypted)
            {
                Command       = command,
                Player        = player.GetPlayer(),
                ReturnMessage = "Command not found.",
                Color         = "red"
            };

            ConsoleCommandEvent.InvokeSafely(ev);

            returnMessage = ev.ReturnMessage;
            color         = ev.Color;
        }
コード例 #2
0
ファイル: PlayerEvents.cs プロジェクト: Killers0992/EXILED
        public static void InvokeConsoleCommand(GameObject obj, string command, bool encrypted, out string returnMessage, out string color)
        {
            OnConsoleCommand onConsoleCommand = ConsoleCommandEvent;

            if (onConsoleCommand == null)
            {
                returnMessage = "Command not found.";
                color         = "red";
                return;
            }

            ReferenceHub        hub = Player.GetPlayer(obj);
            ConsoleCommandEvent ev  = new ConsoleCommandEvent(encrypted)
            {
                Command       = command,
                Player        = hub,
                ReturnMessage = "Command not found.",
                Color         = "red"
            };

            onConsoleCommand?.Invoke(ev);
            returnMessage = ev.ReturnMessage;
            color         = ev.Color;
        }