Page 1 of 3

[Tutorial] How to add a custom command

PostPosted: 23 Apr 2011, 09:28
by dzienny
This post will tell you how to add a custom command step by step.

--You have to create commands folders and the easiest way for that is:--

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 all
public 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

**

TIP
** USE ONLY TRUSTED CODE ** for your computer safety

Re: How to add a custom command

PostPosted: 10 May 2011, 07:49
by iThorneZ
When i compile my file it comes up with an error

Error #CS0006
Message: Metadata file 'MCDziennyR.dll' could not be found
Line: 0

what do i do with the .dll here?

any help?

Re: How to add a custom command

PostPosted: 11 May 2011, 02:11
by OMGiTzME
iThorneZ wrote:When i compile my file it comes up with an error

Error #CS0006
Message: Metadata file 'MCDziennyR.dll' could not be found
Line: 0

what do i do with the .dll here?

any help?


hey i figured out how to get them to compile take the MCDzienny_.dll and copy it paste it in the main folder
then rename it to MCDziennyR.dll

it will compile after

Re: How to add a custom command

PostPosted: 11 May 2011, 07:28
by iThorneZ
OMGiTzME wrote:hey i figured out how to get them to compile take the MCDzienny_.dll and copy it paste it in the main folder
then rename it to MCDziennyR.dll

it will compile after


What do u mean main folder i put it in the MCDziennyLava3.2 folder and it still wont compile

Re: How to add a custom command

PostPosted: 12 May 2011, 21:45
by OMGiTzME
iThorneZ wrote:
OMGiTzME wrote:hey i figured out how to get them to compile take the MCDzienny_.dll and copy it paste it in the main folder
then rename it to MCDziennyR.dll

it will compile after


What do u mean main folder i put it in the MCDziennyLava3.2 folder and it still wont compile


if you did what i said it will work check the compilen error it could be a error in the codeing of the cmd

Re: How to add a custom command

PostPosted: 20 Jun 2011, 02:54
by dzienny
OMGiTzME wrote:
hey i figured out how to get them to compile take the MCDzienny_.dll and copy it paste it in the main folder
then rename it to MCDziennyR.dll

it will compile after


I am really impressed you found a way to make it work.

Hopefully with the current realease nobody will get confused anymore, bug is fixed :)

Re: [Tutorial] How to add a custom command

PostPosted: 29 Jul 2011, 01:37
by Coolsoul
When ever I try to compile I get this error:
Error #CS0006
Message: Metadata file 'System.dll' could not be found
Line: 0

Is a System.dll file suppose to be in the folder?
Any help? Thanks

Re: [Tutorial] How to add a custom command

PostPosted: 29 Jul 2011, 04:05
by PlatinumKiller
Did you open up the MCDzienny_.dll before open up the command, if not then open the _.dll, open the command and make it. Then save the command and in game or on console type /compile <command name> then /cmdload <command name>

Re: [Tutorial] How to add a custom command

PostPosted: 29 Jul 2011, 21:29
by jkl139
Some compilers dont work for me too.

Re: [Tutorial] How to add a custom command

PostPosted: 29 Jul 2011, 21:40
by dzienny
You probably lack the system.dll file on your computer what seems strange since you should have it included with framework. It's used for more advanced commands, but it's not necessary for simple ones. I will add file check with the next udpate. Anyway you can compile any command with Visual Express C#.