Command Hub Help

Command Hub Help

Postby Alshima » 23 Nov 2016, 04:56

Yes, I am back, under a new alias. I need a few questions, I started to make a new command for my new server that is Lava Survival/Freebuild. If anyone still checks on this website, with some knowledge in coding please respond, I need assistance amending my code so I can compile it into my server.

I run my server on MCDzienny 11.1.1.0, I haven't updated it based on my fears of the server consistently crashing again, as it has done so before.

I have these specific errors,

Code: Select all
-------------------------

Error #CS0115
Message: 'MCDzienny.CmdLobby.defaultrank': no suitable method found to override
Line: 13

-------------------------

Error #CS0534
Message: 'MCDzienny.CmdLobby' does not implement inherited abstract member 'MCDzienny.Command.defaultRank.get'
Line: 7


Here is my code,

Code: Select all
//FreshMC
//Made by Fresh+
using System;
using System.IO;
namespace MCDzienny
{
   public class CmdLobby : Command
   {
      public override string name { get { return "lobby"; } }
      public override string shortcut { get { return "hub"; } }
      public override string type { get { return "other"; } }
      public override bool museumUsable { get { return false; } }
      public override LevelPermission defaultrank { get { return LevelPermission.Guest; } }
      public override void Use(Player p, string message)
      {
         if (message == "") { Help(p); return: }
         {
         Command.all.Find("goto").Use(p, "hub2");
         }
      }
         public override void Help(Player p)
         {
            Player.SendMessage(p, "/lobby or /hub - Sends you to the main lobby.");
         }
   }
}


Thanks for the help!

-Fresh or Alsh

*moved to another subsection*
Alshima
 
Posts: 160
Joined: 11 Mar 2013, 02:22
Location: Alshima Island

Help for new Command

Postby Alshima » 23 Nov 2016, 04:58

Yes, I am back, under a new alias. I need a few questions, I started to make a new command for my new server that is Lava Survival/Freebuild. If anyone still checks on this website, with some knowledge in coding please respond, I need assistance amending my code so I can compile it into my server.

I run my server on MCDzienny 11.1.1.0, I haven't updated it based on my fears of the server consistently crashing again, as it has done so before.

I have these specific errors,

Code: Select all
-------------------------

Error #CS0115
Message: 'MCDzienny.CmdLobby.defaultrank': no suitable method found to override
Line: 13

-------------------------

Error #CS0534
Message: 'MCDzienny.CmdLobby' does not implement inherited abstract member 'MCDzienny.Command.defaultRank.get'
Line: 7


Here is my code,

Code: Select all
//FreshMC
//Made by Fresh+
using System;
using System.IO;
namespace MCDzienny
{
   public class CmdLobby : Command
   {
      public override string name { get { return "lobby"; } }
      public override string shortcut { get { return "hub"; } }
      public override string type { get { return "other"; } }
      public override bool museumUsable { get { return false; } }
      public override LevelPermission defaultrank { get { return LevelPermission.Guest; } }
      public override void Use(Player p, string message)
      {
         if (message == "") { Help(p); return: }
         {
         Command.all.Find("goto").Use(p, "hub2");
         }
      }
         public override void Help(Player p)
         {
            Player.SendMessage(p, "/lobby or /hub - Sends you to the main lobby.");
         }
   }
}


Thanks for the help!

-Fresh or Alsh
Alshima
 
Posts: 160
Joined: 11 Mar 2013, 02:22
Location: Alshima Island

Re: Command Hub Help

Postby HelloWorldCool » 23 Nov 2016, 22:10

Hi Alshima,

Normally, the response I would give is that the server software is obsolete but in this case since you are using a basic custom command there should be a solution.

I believe that part of the coding is case sensitive in this line:
"public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }"

The fixed version below should work.

Code: Select all
//Made by Fresh+
using System;
using System.IO;
namespace MCDzienny
{
   public class CmdLobby : Command
   {
      public override string name { get { return "lobby"; } }
      public override string shortcut { get { return "hub"; } }
      public override string type { get { return "other"; } }
      public override bool museumUsable { get { return false; } }
      public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
      public override void Use(Player p, string message)
      {
         if (message == "") { Help(p); return: }
         {
         Command.all.Find("goto").Use(p, "hub2");
         }
      }
         public override void Help(Player p)
         {
            Player.SendMessage(p, "/lobby or /hub - Sends you to the main lobby.");
         }
   }
}



Hope this helps <ok>
HelloWorldCool
Download fCraft maps! - viewtopic.php?f=25&t=3012!



Note: The Developer(s) of MCDzienny have resigned and the software is no longer supported.
Errors are bound to occur and Mojang has not attempted to resolve them.
User avatar
HelloWorldCool
 
Posts: 867
Joined: 18 Oct 2011, 00:19
Location: MCDzienny Forums, HelloWorldCool Forums


Return to Custom Commands

Who is online

Users browsing this forum: No registered users and 1 guest

cron