Ejemplo n.º 1
0
        public bool TryDoCommand(Players.Player player, string chat, List <string> splits)
        {
            ChatCommandManager.GetCommandlist().TryGetValue(chat.Split(' ')[0], out BaseChatCommand command);

            if (command != null)
            {
                return(command.TryDoCommand(player, chat, splits));
            }
            return(false);
        }
Ejemplo n.º 2
0
        protected override bool RunCommand(Players.Player id, string args, List <string> splits)
        {
            List <string> commands = new List <string>();

            foreach (BaseChatCommand command in ChatCommandManager.GetCommandlist().Values)
            {
                if (command.HasPermissions(id))
                {
                    commands.Add(command.ChatCommandPrefix);
                }
            }
            Helpers.Chat.SendSilent(id, string.Join(", ", commands.ToArray()));
            return(true);
        }