void OnInitialize(EventArgs e)
        {
            Commands.ChatCommands.Add(new Command("tprequest.use", TPA, "tpr", "tpa")
            {
                AllowServer = false,
                HelpText    = "Sends a request to teleport to someone."
            });

            if (File.Exists(Path.Combine(TShock.SavePath, "tpconfig.json")))
            {
                Config = Config.Read(Path.Combine(TShock.SavePath, "tpconfig.json"));
            }
            Config.Write(Path.Combine(TShock.SavePath, "tpconfig.json"));
            Timer          = new Timer(Config.Interval * 1000);
            Timer.Elapsed += OnElapsed;
            Timer.Start();
        }
예제 #2
0
        void OnInitialize(EventArgs e)
        {
            Commands.ChatCommands.Add(new Command("tprequest.accept", TPAccept, "tpaccept")
            {
                AllowServer = false,
                HelpText    = "Accepts a teleport request."
            });
            Commands.ChatCommands.Add(new Command("tprequest.autodeny", TPAutoDeny, "tpautodeny")
            {
                AllowServer = false,
                HelpText    = "Toggles automatic denial of teleport requests."
            });
            Commands.ChatCommands.Add(new Command("tprequest.deny", TPDeny, "tpdeny")
            {
                AllowServer = false,
                HelpText    = "Denies a teleport request."
            });
            Commands.ChatCommands.Add(new Command("tprequest.tpahere", TPAHere, "tpahere")
            {
                AllowServer = false,
                HelpText    = "Sends a request for someone to teleport to you."
            });
            Commands.ChatCommands.Add(new Command("tprequest.tpa", TPA, "tpa")
            {
                AllowServer = false,
                HelpText    = "Sends a request to teleport to someone."
            });

            if (File.Exists(Path.Combine(TShock.SavePath, "tpconfig.json")))
            {
                Config = Config.Read(Path.Combine(TShock.SavePath, "tpconfig.json"));
            }
            Config.Write(Path.Combine(TShock.SavePath, "tpconfig.json"));
            Timer          = new Timer(Config.Interval * 1000);
            Timer.Elapsed += OnElapsed;
            Timer.Start();
        }