/quickaction -- Shuts down your server without the timer.

/quickaction -- Shuts down your server without the timer.

Postby _Retaliate_ » 12 Jun 2014, 15:58

/quickaction [shutdown/restart] -- Restarts or shuts down your server without the countdown.
However, you do need to download an extra dll and put it into your MCDzienny folder.
DLL Link: ImageMediaFire link

Code: Select all
// References: "Microsoft.VisualBasic.dll"
using Microsoft.VisualBasic.CompilerServices;
using System;
namespace MCDzienny
{
   internal class CmdQuickaction : Command
   {
      public override string name { get { return "quickaction"; } }
      public override string shortcut { get { return "qact"; } }
      public override string type { get { return "mod"; } }
      public override LevelPermission defaultRank { get { return LevelPermission.Nobody; } }
      public override bool museumUsable { get { return true; } }
      public void Bypass(string name, string command)
      {
         object obj = (object)Command.all.Find(name);
         NewLateBinding.LateCall(obj, null, command, null, null, null, null, true);
      }
      public override void Use(Player p, string message)
      {
         string[] args = message.Split(' ');
         if(args.Length != 1) {
            this.Help(p);
            return;
         } else {
            if(args[0] == "shutdown") {
               Bypass("shutdown", "Shutdown");
            } else if (args[0] == "restart") {
               Bypass("restart", "Restart");
            } else {
               this.Help(p);
               return;
            }
         }
      }
      public override void Help(Player p)
      {
         Player.SendMessage(p, "/quickaction [shutdown/restart] -- Shuts down or restarts without the timer.");
      }
   }
}
Image
_Retaliate_
 
Posts: 68
Joined: 26 Sep 2013, 11:16

Return to Custom Commands

Who is online

Users browsing this forum: No registered users and 1 guest

cron