Author Topic: Simple chat filter?  (Read 624 times)

I'm not really skilled when it comes to making scripts, in fact I'm still learning to read them, but I'd like to try to make a simple chat filter (You have to start somewhere, right?) that makes it so when you say something, you say something else, like how the chat censor replaces "swear words" with asterisks. How would I go about doing this? Thanks to anyone willing to take the time to help.

Package serverCmdMessageSent(GameConnection client,string message)
Mess around with strReplace(string stringToBeParsed,string stringToReplace,string stringToReplaceWith);

With a little bit of messing around I'm sure you could figure out.  If you need anymore help just ask.

Package serverCmdMessageSent(GameConnection client,string message)
Mess around with strReplace(string stringToBeParsed,string stringToReplace,string stringToReplaceWith);

With a little bit of messing around I'm sure you could figure out.  If you need anymore help just ask.

Alright thanks, I'll see what I can do on my own for a bit.

Do you want this to be client-side or server-side?

Do you want this to be client-side or server-side?

Server-side.

EDIT: This could take awhile, I need to sift through my add-ons and learn a little more about scripting first, I have no clue what the hell I'm doing haha

Try echo(strReplace("I'm cool :P","cool","gay")); :P

Try echo(strReplace("I'm cool :P","cool","gay")); :P

I have noooo idea where to even put that. Maybe I should stay away from scripting. o.o

I have noooo idea where to even put that. Maybe I should stay away from scripting. o.o
You could put that in the console by pressing the "~" key.
Or you could put it in a server.cs, create a description.txt modeled after other add-ons, and compress it into a zip. Then name the zip: Script_SomeNameHere.

You could put that in the console by pressing the "~" key.
Or you could put it in a server.cs, create a description.txt modeled after other add-ons, and compress it into a zip. Then name the zip: Script_SomeNameHere.

I know how to package all of that stuff, I just don't know what to put or in what order to put everything in the server.cs.

The order is more of a preference in most cases.