[Tutorial] How to add a custom command

[Tutorial] How to add a custom command

Postby dzienny » 23 Apr 2011, 09:28

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
User avatar
dzienny
Administrator
 
Posts: 1181
Joined: 23 Jan 2011, 14:27

Re: How to add a custom command

Postby iThorneZ » 10 May 2011, 07:49

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?
iThorneZ
 
Posts: 8
Joined: 27 Apr 2011, 07:30

Re: How to add a custom command

Postby OMGiTzME » 11 May 2011, 02:11

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
OMGiTzME
 
Posts: 5
Joined: 10 May 2011, 06:11

Re: How to add a custom command

Postby iThorneZ » 11 May 2011, 07:28

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
iThorneZ
 
Posts: 8
Joined: 27 Apr 2011, 07:30

Re: How to add a custom command

Postby OMGiTzME » 12 May 2011, 21:45

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
OMGiTzME
 
Posts: 5
Joined: 10 May 2011, 06:11

Re: How to add a custom command

Postby dzienny » 20 Jun 2011, 02:54

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 :)
User avatar
dzienny
Administrator
 
Posts: 1181
Joined: 23 Jan 2011, 14:27

Re: [Tutorial] How to add a custom command

Postby Coolsoul » 29 Jul 2011, 01:37

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
Coolsoul
 
Posts: 1
Joined: 25 Jul 2011, 03:11

Re: [Tutorial] How to add a custom command

Postby PlatinumKiller » 29 Jul 2011, 04:05

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>
Image
User avatar
PlatinumKiller
 
Posts: 388
Joined: 22 Jun 2011, 22:55
Location: MCDzienny Forums

Re: [Tutorial] How to add a custom command

Postby jkl139 » 29 Jul 2011, 21:29

Some compilers dont work for me too.
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 dzienny » 29 Jul 2011, 21:40

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#.
User avatar
dzienny
Administrator
 
Posts: 1181
Joined: 23 Jan 2011, 14:27

Next

Return to How-To

Who is online

Users browsing this forum: No registered users and 1 guest

cron