How to add text filter like ablockz (_Ultima_'s server)

How to add text filter like ablockz (_Ultima_'s server)

Postby toystory_justin » 07 Dec 2012, 10:59

Hey! It's me again, justin. I need help. I want to add text filter like ablockz (_Ultima_'s server) Please help me, I really want to know how to do it. Thanks! :lol: :D
toystory_justin
 
Posts: 224
Joined: 11 Nov 2012, 07:12
Location: On a dark place

Re: How to add text filter like ablockz (_Ultima_'s server)

Postby ismellike » 07 Dec 2012, 14:00

viewtopic.php?f=21&t=1009

Ultima finished it off on same page, you just need to add the words.
What a beast...
User avatar
ismellike
Coder
 
Posts: 731
Joined: 31 Oct 2012, 04:04
Location: Kansas

Re: How to add text filter like ablockz (_Ultima_'s server)

Postby 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?
toystory_justin
 
Posts: 224
Joined: 11 Nov 2012, 07:12
Location: On a dark place


Return to How-To

Who is online

Users browsing this forum: No registered users and 2 guests

cron