コード例 #1
0
        public override void Use(Player p, string message)
        {
            if (Command.all.Contains(message.Split(' ')[0]))
            {
                Player.SendMessage(p, "That command is already loaded!");
                return;
            }

            string[] param = message.Split(' ');
            string   name  = "Cmd" + param[0];


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