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-20-2006 , 20:12  
Reply With Quote #1

Well I tested it, but dont replace, I mean the player say "shit" and then apear : "I said shit, I will be kick" (you can see both).
Im trying to replace a word in the SAME SENTENCE. I mean: a player write "Come on play on xxxgameserver", xxgameserver is the word on swearwords.ini and the sentences in plugin is
Code:
"%s ^"our poorly and bad %s^""
so the original sentence will be replace by "Come on play on our poorly and bad xxgameserver". Could be possible to do it?
Flashhh! is offline
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 03-20-2006 , 20:39  
Reply With Quote #2

Code:
#include <amxmodx> #include <amxmisc> new configfile[200] new just_said[33] public plugin_init() {     register_plugin("Swear Filter","1.0a","SuicideDog")     register_clcmd("say","swearcheck")     register_clcmd("say_team","swearcheck")     new configsdir[200]     get_configsdir(configsdir,199)     format(configfile,199,"%s/swear/swearwords.ini",configsdir) } public swearcheck(id) {     new text[200]     read_args(text,199)     if(!just_said[id])     {         for(new i=0;i<=file_size(configfile,1)-1;i++)         {             new read[32]             new trash             read_file(configfile,i,read,31,trash)             if((contain(text,read)!=-1))             {                 just_said[id]=true                 new saytype[32]                 new read2[32]                 read_file(configfile,i+1,read2,31,trash)                 replace(text,199,read,read2)                 read_argv(0,saytype,31)                 client_cmd(id,"%s %s",saytype,text)                 set_task(0.2,"just_didnt_said",id)                 return PLUGIN_HANDLED             }         }     }     return PLUGIN_CONTINUE } public just_didnt_said(id) {     just_said[id]=false     return PLUGIN_HANDLED }

here, this plugin will replace whatever is found in the .ini file with whats on the next line of the .ini file. In Example:

.ini file reads:
Fuck
OMFG

player types:
Fuck You!

Instead he says:
OMFG You!

However this version is now case sensitive. If the player types "fuck" instead of "Fuck" it will not catch it. If he types "fucK" it won't catch it either. Etc. Etc.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
Flashhh!
Senior Member
Join Date: Nov 2005
Old 03-20-2006 , 23:43  
Reply With Quote #3

THANKS GHW_Chronic!! Finally it works!! . It does exactly what I need!! Karma for you!!
Black Rose thank you also!
Im Happy Scriping forum works!
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