Exemple #1
0
        public override void Use(Player p, string message)
        {
            if (message == "")
            {
                Help(p); return;
            }
            if (Command.all.Contains(message.Split(' ')[0]))
            {
                Player.SendMessage(p, "That command is already loaded!");
                return;
            }
            message = "Cmd" + message.Split(' ')[0];;
            string error = Scripting.Load(message);

            if (error != null)
            {
                Player.SendMessage(p, error);
                return;
            }
            GrpCommands.fillRanks();
            Player.SendMessage(p, "Command was successfully loaded.");
        }
Exemple #2
0
 public static void Autoload()
 {
     if (!File.Exists("text/cmdautoload.txt"))
     {
         File.Create("text/cmdautoload.txt");
         return;
     }
     string[] autocmds = File.ReadAllLines("text/cmdautoload.txt");
     foreach (string cmd in autocmds)
     {
         if (cmd == "")
         {
             continue;
         }
         string error = Scripting.Load("Cmd" + cmd.ToLower());
         if (error != null)
         {
             Server.s.Log(error);
             error = null;
             continue;
         }
         Server.s.Log("AUTOLOAD: Loaded " + cmd.ToLower() + ".dll");
     }
 }