Error when trying to compile a command!?

Error when trying to compile a command!?

Postby crazyscouter » 18 Nov 2011, 21:13

ok so i am trying to add a /warn code created by the green color guy lol and i am folowing the directions below but when i do it it says "compilation error see compile.log for more infromation" or something along the lines of that, and i dont know what to do.

Here are the code directions i used:

1) In console Command: write "cmdcreate test"

--Now you have all the folders. They were created automatically and additionaly you got Cmdtest.cs--
--Cmdtest.cs contains sample code. It is actually a framework for your coding, but it's another topic--

2) Open notepad
3) Copy to the notepad a code of the command you want ot use, for example ,i've posted one, here>> viewtopic.php?f=11&t=320
4) Now save the file into mcdzienny/extra/commands/source directory as Cmd[name].cs

--It's time for changing code into some computer only known data ^^--

5) In console Command: write "compile [name]"

--Okey we have now *.dll file, it's in the mcdzienny/extra/commands/dll/ (for the record)--

6) In console Command: write "cmdload [name]"

--Command loaded. Hurray!--
--Now you can use it, simply use command /[command mask]--

**
[command mask] may be different than [name] (but it shouldn't be so)

how to find this mask? it's simple, it's in the code in the beginning:
Code: Select allpublic override string name { get { return "do"; } }

look for similar text in the fists lines of the code and there you have info "string name (...) "do" (...)"
/do is your actual command in this example


For the code i named it Cmdwarn.cs and it still comes up as that.

Here is the cod i am trying to add:

Code: Select all
using System;

namespace MCDzienny
   public class CmdWarn : Command
   {
      public override string name { get { return "warn"; } }

      public override string shortcut { get { return ""; } }

      public override string type { get { return "mod"; } }

      public override bool museumUsable { get { return true; } }

      public override LevelPermission defaultRank { get { return LevelPermission.Builder; } }

        public override void Use(Player p, string message)
        {
            if (message == "") { Help(p); return; }
            Player who = Player.Find(message.Split(' ')[0]);
            if (who == null)
            {
                Player.SendMessage(p, "Player not found!");
            }
            {
                Player.GlobalMessage(p.color + p.name + " %ewarned " + who.color + who.name + "%e!");
                Player.SendMessage(p, "%eDo it again you could be banned!");
            }
        }

      public override void Help(Player p)
      {
         Player.SendMessage(p, "/warn - Warns a player.");
      }
   }
}






Thank you, any help would be greatly appreciated
crazyscouter
 
Posts: 13
Joined: 18 Nov 2011, 21:06

Re: Error when trying to compile a command!?

Postby dzienny » 18 Nov 2011, 21:30

Alright, but what's the error message? Check the error message, it is in 'logs/errors/compiler.log' and post it here.
User avatar
dzienny
Administrator
 
Posts: 1181
Joined: 23 Jan 2011, 14:27

Re: Error when trying to compile a command!?

Postby HelloWorldCool » 18 Nov 2011, 21:34

In your case if you really did do: /cmdcreate test
the file name you are to compile is "test"

So in this case if you do: /compile test
there shouldn't be an error.

I'm not exactly certain if you understand how to compile a command.
(My point is If you did /compile warn then it won't work)
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: Error when trying to compile a command!?

Postby crazyscouter » 18 Nov 2011, 21:37

ok i did that and it said: File Does Not Exist

even though i put it under the extra/commands/source folder... and it is saved as: Cmdwarn.cs
crazyscouter
 
Posts: 13
Joined: 18 Nov 2011, 21:06

Re: Error when trying to compile a command!?

Postby HelloWorldCool » 18 Nov 2011, 21:41

Okay then now here is the fastest solution.

You should post all of the code you have in CmdWarn.cs here.
I will tell you if you have anything wrong.

My initial thought process tells me it could have just been a major editing problem.
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: Error when trying to compile a command!?

Postby crazyscouter » 18 Nov 2011, 21:42

Ok nevermind i figured it out, i didnt realize that i had to do /cmdcreate warn first lol
crazyscouter
 
Posts: 13
Joined: 18 Nov 2011, 21:06

Re: Error when trying to compile a command!?

Postby HelloWorldCool » 18 Nov 2011, 21:44

Okay, have fun with the new command ;)
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: Error when trying to compile a command!?

Postby crazyscouter » 18 Nov 2011, 21:46

ok thank you guys for the help, i appreciate it.
crazyscouter
 
Posts: 13
Joined: 18 Nov 2011, 21:06


Return to Help

Who is online

Users browsing this forum: No registered users and 25 guests

cron