by toystory_justin » 08 Dec 2012, 02:19
No bro, Idk how to add the using System;
namespace MCDzienny
{
public class CmdChatFilter : Command
{
//Don't change it
public override string name { get { return ""; } }
public override string shortcut { get { return ""; } }
public override string type { get { return ""; } }
public override bool museumUsable { get { return false; } }
public override LevelPermission defaultRank { get { return LevelPermission.Banned; } }
// Init is executed when the code is loaded
public override void Init()
{
// You tell the server to send arguments to FilterChat method when PlayerChatEvent occures
Player.PlayerChatEvent += FilterChat;
}
// Here's the place where you want to write your filter code
// You get Player object that describes the player who tries to send a message,
// string message is the message that is about to be send,
// bool stopIt is false by default, and if you set it to true the message will not be send
private void FilterChat(Player p, ref string message, ref bool stopIt)
{
// you may, but you don't have to copy 'message' value to local variable
// you may as well perform changes on 'message'
string changedMessage = message;
// hash sign is added to the beginning of the message
changedMessage = "#" + changedMessage;
// 'message' value is now changed to 'changedMessage' value
message = changedMessage;
}
// Don't change it
public override void Help(Player p)
{ }
public override void Use(Player p, string message)
{ }
}
}
Where do I paste them on?