Page 2 of 3

Re: [Tutorial] How to add a custom command

PostPosted: 29 Jul 2011, 21:43
by jkl139
I will try to download that..

Re: [Tutorial] How to add a custom command

PostPosted: 29 Nov 2011, 03:51
by ZOMGxReferendum
When i do this i get hello world. -_-

Re: [Tutorial] How to add a custom command

PostPosted: 29 Nov 2011, 04:42
by HelloWorldCool
ZOMGxReferendum wrote:When i do this i get hello world. -_-


Same thing for my players. PlatinumKiller will probably make an update soon.

Re: [Tutorial] How to add a custom command

PostPosted: 29 Nov 2011, 04:55
by ZOMGxReferendum
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 :/

Re: [Tutorial] How to add a custom command

PostPosted: 29 Nov 2011, 05:05
by HelloWorldCool
It's ok just be patient. Everything will be resolved! ;)

Re: [Tutorial] How to add a custom command

PostPosted: 29 Nov 2011, 05:08
by ZOMGxReferendum
:D

Re: [Tutorial] How to add a custom command

PostPosted: 29 Nov 2011, 05:27
by ZOMGxReferendum
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

Re: [Tutorial] How to add a custom command

PostPosted: 30 Nov 2011, 09:18
by Ultima
Did u recompile it?

Re: [Tutorial] How to add a custom command

PostPosted: 01 Dec 2011, 21:06
by ZOMGxReferendum
Yes.

Re: [Tutorial] How to add a custom command

PostPosted: 05 Dec 2011, 16:13
by Ultima
unload high5.dll (if loaded)
Delete the orginal high5.dll and recompile it.
load high5