示例#1
0
        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;
        }
示例#2
0
 internal static void StrikeConsoleCommand(string cmd, string[] args)
 {
     OnConsoleCommand?.Invoke(cmd, args);
 }