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