Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Feature] Client Swear Filter
#1
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
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)