[Tutorial] How to add a custom command

Re: [Tutorial] How to add a custom command

Postby jkl139 » 29 Jul 2011, 21:43

I will try to download that..
Image
Image
User avatar
jkl139
 
Posts: 444
Joined: 13 Jun 2011, 11:46
Location: MCDzienny Forum

Re: [Tutorial] How to add a custom command

Postby ZOMGxReferendum » 29 Nov 2011, 03:51

When i do this i get hello world. -_-
ZOMGxReferendum
 
Posts: 6
Joined: 16 May 2011, 18:40

Re: [Tutorial] How to add a custom command

Postby HelloWorldCool » 29 Nov 2011, 04:42

ZOMGxReferendum wrote:When i do this i get hello world. -_-


Same thing for my players. PlatinumKiller will probably make an update soon.
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

Re: [Tutorial] How to add a custom command

Postby ZOMGxReferendum » 29 Nov 2011, 04:55

Yea and when i tried to delete it and start over i got these errors


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

Error #CS0246
Message: The type or namespace name 'Command' could not be found (are you missing a using directive or an assembly reference?)
Line: 3

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

Error #CS0246
Message: The type or namespace name 'LevelPermission' could not be found (are you missing a using directive or an assembly reference?)
Line: 9

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

Error #CS0246
Message: The type or namespace name 'Player' could not be found (are you missing a using directive or an assembly reference?)
Line: 11

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

Error #CS0246
Message: The type or namespace name 'Player' could not be found (are you missing a using directive or an assembly reference?)
Line: 32

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

Sadly I don't know how to code yet so :/
ZOMGxReferendum
 
Posts: 6
Joined: 16 May 2011, 18:40

Re: [Tutorial] How to add a custom command

Postby HelloWorldCool » 29 Nov 2011, 05:05

It's ok just be patient. Everything will be resolved! ;)
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

Re: [Tutorial] How to add a custom command

Postby ZOMGxReferendum » 29 Nov 2011, 05:08

:D
ZOMGxReferendum
 
Posts: 6
Joined: 16 May 2011, 18:40

Re: [Tutorial] How to add a custom command

Postby ZOMGxReferendum » 29 Nov 2011, 05:27

Ok i got it to compiled without the errors


Code: Select all
namespace MCDzienny
{
    public class CmdHigh5 : Command
    {
        public override string name { get { return "high5"; } }
        public override string shortcut { get { return ""; } }
        public override string type { get { return "other"; } }
        public override bool museumUsable { get { return false; } }
        public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
        public CmdHigh5() { }
        public override void Use(Player p, string message)
        {
            if (message == "")
            {
                Help(p);
            return;
            }
            Player player1 = Player.Find(message);
            if (player1 == null || player1.hidden == true)
            {
                Player.SendMessage(p, "Could not find player specified.");
            return;
            }

         string giver = (p == null) ? "The Console" : p.name;
         string color = (p == null) ? "" : p.color;
            Player.SendMessage(player1, giver + " just highfived you");
            Player.GlobalMessage(color + giver + " " + Server.DefaultColor + "just highfived " + player1.color + player1.name);
        }

        // This one controls what happens when you use /help [commandname].
        public override void Help(Player p)
        {
            Player.SendMessage(p, "/high5 <player> - High five someone :D");
        }
    }
}

Had to change where it says namespace at the top *facepalm* lol

But now it says the .dll doesnt exist
ZOMGxReferendum
 
Posts: 6
Joined: 16 May 2011, 18:40

Re: [Tutorial] How to add a custom command

Postby Ultima » 30 Nov 2011, 09:18

Did u recompile it?
User avatar
Ultima
 
Posts: 953
Joined: 19 Aug 2011, 23:45

Re: [Tutorial] How to add a custom command

Postby ZOMGxReferendum » 01 Dec 2011, 21:06

Yes.
ZOMGxReferendum
 
Posts: 6
Joined: 16 May 2011, 18:40

Re: [Tutorial] How to add a custom command

Postby Ultima » 05 Dec 2011, 16:13

unload high5.dll (if loaded)
Delete the orginal high5.dll and recompile it.
load high5
User avatar
Ultima
 
Posts: 953
Joined: 19 Aug 2011, 23:45

PreviousNext

Return to How-To

Who is online

Users browsing this forum: No registered users and 1 guest

cron