Raised This Month: $ Target: $400
 0% 

Help Changing this part of swear filter plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Flashhh!
Senior Member
Join Date: Nov 2005
Old 03-18-2006 , 19:46  
Reply With Quote #1

Thanks Blackrose! But now I have another problem, this plugin only works with the word "lol", I tried another words but if I use caps or a sentence (with 3 words) the server crash, also if I dont use caps and put a word with 3 or more letters dont work. The strange thing is that if I put "lolololo" works but if I put "byebye" dont or any other word like "tjudegracha" dont work...
Which is the problem?
Flashhh! is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-18-2006 , 20:09  
Reply With Quote #2

u mean it only replaces "lol" or only replaces WITH lol?
[ --<-@ ] Black Rose is offline
Flashhh!
Senior Member
Join Date: Nov 2005
Old 03-18-2006 , 20:18  
Reply With Quote #3

Quote:
Originally Posted by [ --<-@
Black Rose]u mean it only replaces "lol" or only replaces WITH lol?
Sorry was my fault!. I discover MY problem. If I want to use this plugin with someone that say shit I can not put in swearwords.ini "I will be kick because I said shit" or "shit is a bad word" because it say two times shit(one the player and the other the plugin" and the server crash. So could this plugin have the option that if the word/sentences come from swerwords.ini can show it and not lock it?
Flashhh! is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-18-2006 , 21:37  
Reply With Quote #4

what?
i just realized. does this block the "real" message and replace it OR does this write first the changed message and then the "real" one
[ --<-@ ] Black Rose is offline
Flashhh!
Senior Member
Join Date: Nov 2005
Old 03-19-2006 , 00:42  
Reply With Quote #5

Quote:
Originally Posted by [ --<-@
Black Rose]what?
i just realized. does this block the "real" message and replace it OR does this write first the changed message and then the "real" one
example of the problem: one player said "fucking shit". The plugin have on swearwords.ini the word "shit" and on #define word "I said shit and I will be kick". So if the plugin works fine should write "fucking I said shit and I will be kick" BUT the problem is that the "fucking I said shit and I will be kick" contain one "shit" and now the plugin try to block them (is trying to block his own sentence) and the server crash. So is possible that the plugin recognise his owns words and not try to correct it again and again?

Anyway if you cant hlep me thanks becauseyou helped me. Karma for you.
Flashhh! is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-19-2006 , 00:45  
Reply With Quote #6

LOL! x]
yeah, we can probably fix that...
[ --<-@ ] Black Rose is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-19-2006 , 01:10  
Reply With Quote #7

try it
Code:
#include <amxmodx> #include <amxmisc> // max number of words in word list #define MAX_WORDS 192 new g_swearsNames[MAX_WORDS][32] new g_swearsNum new bool:immune[33] public plugin_init() {     register_plugin("Swear Filter","1.0a","SuicideDog")     register_clcmd("say","swearcheck")     register_clcmd("say_team","swearcheck")     readList() } readList() {     new szCustomDir[64]     new filename[64]     get_customdir( szCustomDir, 63 )     format(filename, 63, "%s/swear/swearwords.ini", szCustomDir )         if(!file_exists(filename) ) {         log_message("Swear Filter: file %s not found", filename)         return     }     new iLen     while( g_swearsNum < MAX_WORDS && read_file(filename, g_swearsNum ,g_swearsNames[g_swearsNum][1],30,iLen) ) {         if( g_swearsNames[g_swearsNum][0] == ';') continue         g_swearsNames[g_swearsNum][0] = iLen         ++g_swearsNum     }     log_message("Swear Filter: loaded %d words",g_swearsNum ) } public swearcheck(id) {     if ( !immune[id] ) {         new szSaid[192]         read_args(szSaid,191)         new bool:found = false         new i = 0         while ( i < g_swearsNum ) {             if ( ( containi(szSaid,g_swearsNames[i][1])) != -1 ) {                 formatex(szSaid, 191, "I said %s, Kick me!! =)", g_swearsNames[i][1])                 found = true                 continue             }             ++i         }         if ( found ) {             new cmd[32]             read_argv(0,cmd,31)             immune[id] = true             engclient_cmd(id,cmd,szSaid)             set_task(0.5, "remove_immune", id)         }     }     return PLUGIN_CONTINUE } stock name(index) {     new temp[32]     get_user_name(index, temp, 31)     return temp } public remove_immune(id) {     immune[id] = false }
[ --<-@ ] Black Rose is offline
Flashhh!
Senior Member
Join Date: Nov 2005
Old 03-19-2006 , 01:29  
Reply With Quote #8

Dont compile . Formatex undefine symbol and other error.
Flashhh! is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-19-2006 , 06:08  
Reply With Quote #9

lol, you don't have 1.70? just remove formatex and it will work.
[ --<-@ ] Black Rose is offline
Flashhh!
Senior Member
Join Date: Nov 2005
Old 03-19-2006 , 19:22  
Reply With Quote #10

The server still crashing when I put a word included in swearwords.ini : I think is the same error than before that make a looping and crash the server. I mean now your new modifications of the plugin says:
Code:
formatex(szSaid, 191, "I said %s, Kick me!! =)", g_swearsNames[i][1])
So if you put "shit" on swearwords.ini and a player say the word "shit", the plugin will return "I said shit, Kick me!! =)" BUT the plugin detect "shit" in that sentence and try to put again "I said shit, Kick me!! =)" and try do it for ever!... and the server crash!... I think that the plugin should includ another "if" that says if the sentence is "I said shit, Kick me!! =)" dont lock or try to modify so I think It will work.

PD: I have 3 gameservers and one of them had 1.60, now all have 1.70 and works with "formatex".
Flashhh! is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode