Mirage Source http://web.miragesource.net/forums/ |
|
[Feature] Client Swear Filter http://web.miragesource.net/forums/viewtopic.php?f=183&t=4385 |
Page 1 of 56 |
Author: | William [ Sat Sep 20, 2008 10:01 am ] |
Post subject: | [Feature] Client Swear Filter |
Originaly Created by Obsidian Edited and refined by William Difficulty: 1/5 Functionality: Works for all versions of MS. Introduction A standared simple client side swear filter that's added in 2-5minutes easily. Client Side Add this at the bottom of modGameLogic: Code: Public Function CheckMessage(byval Msg As String) As String Dim kArray() As String Dim Swears As String Dim i As Integer Dim SwearChar As String Swears = "ass,fuck,shit,bitch,damn,cunt,whore,piss,jesus,god" kArray = Split(Swears, ",") SwearChar = "*" For i = 0 To UBound(kArray) If InStr(LCase(Msg$), LCase(kArray(i))) Then Msg$ = Replace$(LCase(Msg$), LCase(kArray(i)), LCase(String(Len(kArray(i)), SwearChar))) End If Next i CheckMessage = Msg End Function Now search for all the different messages: adminmsg, saymsg, broadcastmsg, globalmsg, playermsg, mapmsg. And do this on all of them: Code: Call GlobalMsg(ChatText) Replace it with: Code: Call GlobalMsg(CheckMessage(ChatText)) And of course you shouldn't replace the saymsg call with a globalmsg call... Good Luck And have Fun |
Author: | William [ Sat Sep 20, 2008 4:10 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
Yey, great! 25 points for me suckers |
Author: | Mattyw [ Sun Sep 21, 2008 1:50 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
How can I modify it so that there is more than one SwearChar that are Random. Such as: *!?@£$ Tried a few ways, but obviously would've failed. EDIT: Managed to get it so it does random out of the characters "*!?@$": Code: Public Function CheckMessage(ByVal Msg As String) As String Dim kArray() As String Dim SwearCensor As String Dim Swears As String Dim i As Integer Dim SwearChars As String Dim SwearRnd As String Dim strname As String Swears = "ass,fuck,shit,bitch,biatch,cunt,whore,piss,bastard,crap,nigger,pussy,penis,vagina,wank,masterbate" kArray = Split(Swears, ",") SwearChars = "*@!?$" SwearCensor = Len(SwearChars) SwearRnd = Int((SwearCensor * Rnd) + 1) strname = strname & Mid(SwearChars, SwearRnd, 1) For i = 0 To UBound(kArray) If InStr(LCase(Msg$), LCase(kArray(i))) Then Msg$ = Replace$(LCase(Msg$), LCase(kArray(i)), LCase(String(Len(kArray(i)), strname))) End If Next i CheckMessage = Msg End Function Still need to make it actually do like "*!?@$" instead of "@@@@@". |
Author: | mustorze [ Sun Sep 21, 2008 3:50 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
Perfect |
Author: | Tosuxo [ Tue Nov 04, 2008 3:03 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
wouldn't this cause all messages to go lower case? |
Author: | Doomy [ Tue Nov 04, 2008 5:32 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
just wondering what if they dont cuss what if instead of saying ass they say i assisted that man the other day will it do assisted |
Author: | GIAKEN [ Tue Nov 04, 2008 5:41 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
Yes it would. |
Author: | Doomy [ Tue Nov 04, 2008 8:21 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
thats bad i mean lots of cuss words are in normal words Assisted Class Bass mass umm im out but you get the point |
Author: | GIAKEN [ Tue Nov 04, 2008 8:24 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
Just add a space around the word and fixed. |
Author: | wanai [ Mon Dec 27, 2021 11:20 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
Econ |
Author: | wanai [ Mon Dec 27, 2021 11:21 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
49.9 |
Author: | wanai [ Mon Dec 27, 2021 11:22 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
Bett |
Author: | wanai [ Mon Dec 27, 2021 11:23 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
Bett |
Author: | wanai [ Mon Dec 27, 2021 11:24 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
Pros |
Author: | wanai [ Mon Dec 27, 2021 11:26 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
Quel |
Author: | wanai [ Mon Dec 27, 2021 11:27 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
Laru |
Author: | wanai [ Mon Dec 27, 2021 11:28 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
Stan |
Author: | wanai [ Mon Dec 27, 2021 11:29 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
Mary |
Author: | wanai [ Mon Dec 27, 2021 11:30 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
ARIS |
Author: | wanai [ Mon Dec 27, 2021 11:31 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
Your |
Author: | wanai [ Mon Dec 27, 2021 11:32 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
Prov |
Author: | wanai [ Mon Dec 27, 2021 11:33 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
Comp |
Author: | wanai [ Mon Dec 27, 2021 11:35 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
Micr |
Author: | wanai [ Mon Dec 27, 2021 11:36 pm ] |
Post subject: | Re: [Feature] Client Swear Filter |
Magi |
Page 1 of 56 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |