Ulysses
Ulysses Stuff => Suggestions => Topic started by: johnlukeg 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.
-
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 (http://forums.ulyssesmod.net/index.php/topic,3339.45.html)
and here's the code.
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 )
-
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.
-
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.