Load() public static method

Loads a command for use on the server.
public static Load ( string command ) : string
command string Name of the command to be loaded (make sure it's prefixed by Cmd before bringing it in here or you'll have problems).
return string
Esempio n. 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.");
        }
Esempio n. 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");
     }
 }