Author Topic: Ban Words?  (Read 2855 times)

0 Members and 1 Guest are viewing this topic.

Offline johnlukeg

  • Newbie
  • *
  • Posts: 27
  • Karma: -1
Ban Words?
« on: September 15, 2008, 11:06:16 AM »
Well, I'm getting really tired of people saying racial slurs all the time on my server and getting away with it while I'm not on.  Anyone know of an addon where I can add banwords and set the ban time?  I mean, I'd assume it would be ulx related.... maybe I'm barking up the wrong tree though and I should just ask on Facepunch or something. 


Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
Re: Ban Words?
« Reply #1 on: September 15, 2008, 02:22:15 PM »
The problem with the banning or filtering of words and phrases, is that it never ends with update. You have to account for the thousands of symbol and character combinations that people will find to say what they want to say reguardless of the filter, I've made an addon like this before. It's truly endless.

==EDIT==
Ok, I took the time and looked up my old post for you HERE
and here's the code.

Code: [Select]
WordD = { "word1" , "word2" }  -- This is your word list. These are not case sensitive, and periods are removed by script and are not necessary in wordlist.
function WFilter( ply, text, toall )
local WordC = nil
      if string.find( text, ".", 1, true) then
         text = string.Replace( text, ".", "") -- removes all periods
      end
         for _, v in ipairs( WordD ) do
             if string.find( string.Replace(text:lower(), " ",""), v, 1, true) then --#1 <-- lowers the text's case and test to see if it equals any word in the table
                text = (string.Replace( string.Replace(text:lower(), " ",""), v, (string.rep( "*",string.len(v))))) --#2 text will be changed, and text in line above (#1) will be changed to include a * for each character for v
                WordC = true --#3 set true...something was found.
             end
         end
if WordC then return text else return end --#4 If something found, return censored text.. If not, just return to let other scripts look at the text.
end
hook.Add( "PlayerSay", "WFilter", WFilter )
« Last Edit: September 15, 2008, 03:16:07 PM by jay209015 »
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Ban Words?
« Reply #2 on: September 15, 2008, 04:00:05 PM »
As Jay said about constant updates, you start eating up valuable CPU time with tables/lists once a troublemaker knows the script is there.
If they get banned temporarily, and want to cause trouble, they'll have friends come in and try all kinds of different ways to say the same word they got banned for.
I wouldn't recommend it as lists would grow quite large, and behaving players would grow annoyed.

Perhaps you could use Jay's release "Arequest" from our releases forum.
Though meant for addon requests and such, maybe it could be used for offended players to post names of people who swear.
If not Arequest, I've seen other player report addons, just not sure exactly the name. Look here and Facepunch releases.

"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
Re: Ban Words?
« Reply #3 on: September 15, 2008, 04:33:33 PM »
Quote
Perhaps you could use Jay's release "Arequest" from our releases forum.
Though meant for addon requests and such, maybe it could be used for offended players to post names of people who swear.
If not Arequest, I've seen other player report addons, just not sure exactly the name. Look here and Facepunch releases.
     -I totally forgot about that addon, one of the rare occasions where I think I've fixed all the problems lol.
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly