Raised This Month: $51 Target: $400
 12% 

#define MAX_WORDS 192


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Evaldas.Grigas
Senior Member
Join Date: Sep 2011
Location: Lithuania
Old 10-05-2011 , 10:47   #define MAX_WORDS 192
Reply With Quote #1

Can I make it whatever I want?
Evaldas.Grigas is offline
Send a message via Skype™ to Evaldas.Grigas
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 10-05-2011 , 11:25   Re: #define MAX_WORDS 192
Reply With Quote #2

Begin with telling us what plugin you're talking about, and then post the code of that specific plugin. #define MAX_WORDS 192 says nothing unless some code is shown.
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
Evaldas.Grigas
Senior Member
Join Date: Sep 2011
Location: Lithuania
Old 10-05-2011 , 13:42   Re: #define MAX_WORDS 192
Reply With Quote #3

I am using simple swear filter.
PHP Code:
/* AMX Mod script. 

* (c) Copyright 2004, SuicideDog 
* This file is provided as is (no warranties). 
* Code gleemed from old RAV plugin.

* Simple Swear filter.  Replaces badwords with *'s
*
* Uses swearwords.ini file (/$customdir/swear/swearwords.ini)
* It can use the same file as RS's advanced swear filter.
*
* I made this because it's easier to use. No config and one ini file

*/ 

#include <amxmodx>
#include <amxmisc> 

// max number of words in word list 
#define MAX_WORDS 190

new g_swearsNames[MAX_WORDS][32
new 
g_swearsNum 

public plugin_init() 

    
register_plugin("Swear Filter","1.0a","SuicideDog"
    
register_clcmd("say","swearcheck"
    
register_clcmd("say_team","swearcheck")
    
readList()
}

readList() 

    
// file to read words from 
    
new szCustomDir[64]
    new 
filename[64]
    
get_customdirszCustomDir63 )
    
format(filename63"%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(filenameg_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
{
    new 
szSaid[192]
    
read_args(szSaid,191)
    new 
bool:found false
    
new pos0
    
while ( g_swearsNum )
    {
    if ( (
pos containi(szSaid,g_swearsNames[i][1])) != -)
    { 
        new 
len g_swearsNames[i][0
        while(
len--)
        
szSaid[pos++] = '*'
        
found true 
        
continue
    }
    ++
i
    
}
    if ( 
found ){ 
        new 
cmd[32]
        
read_argv(0,cmd,31)          
        
engclient_cmd(id,cmd,szSaid)    
    }
    return 
PLUGIN_CONTINUE 

Evaldas.Grigas is offline
Send a message via Skype™ to Evaldas.Grigas
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 10-05-2011 , 13:55   Re: #define MAX_WORDS 192
Reply With Quote #4

If your file contains more than 192 words, then yes, the define could be altered. The define is simply to put a maximum amount of words to filter.
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
Evaldas.Grigas
Senior Member
Join Date: Sep 2011
Location: Lithuania
Old 10-05-2011 , 13:57   Re: #define MAX_WORDS 192
Reply With Quote #5

Ok thank you.
Evaldas.Grigas is offline
Send a message via Skype™ to Evaldas.Grigas
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 01:44.


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