Raised This Month: $ Target: $400
 0% 

My AutoBan plugin is not working (based on SwearReplacements)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AnHiMiLaToR
Member
Join Date: Mar 2007
Old 11-03-2007 , 19:34   My AutoBan plugin is not working (based on SwearReplacements)
Reply With Quote #1

Please help me!
When I say some word from the ban.ini file it doesn't ban me...

Here's the code:
PHP Code:
#include <amxmodx>
#include <amxmisc> 
#define MAX_WORDS 200
new g_banWords[MAX_WORDS][200]
new 
g_banNum

public plugin_init()
{
    
register_plugin "Auto BAN""1.0""kaboomkazoom & AnHiMiLaToR")
    
register_concmd "aban_add""aban_add"ADMIN_LEVEL_A "" )
    
readList()
}

readList()
{
    new 
Configsdir[64]
    new 
ban_file[64]
    
get_configsdirConfigsdir63 )
    
format(ban_file63"%s/ban.ini"Configsdir )
    

    if ( !
file_exists(ban_file) )
    {
        
server_print "==========================================================" )
        
server_print "[Auto BAN] %s file not found"ban_file )
        
server_print "==========================================================" )
        return
    }
    
    new 
leni=0
    
while( MAX_WORDS && read_fileban_fileg_banWords[g_banNum], 19len ) )
    {
        
i++
        if( 
g_banWords[g_banNum][0] == ';' || len == )
            continue
        
g_banNum++
    }


}


public 
bancheck(id)
    {

    new 
said[192]
    
read_args said191 )

    new 
0
    
while ( g_banNum )
    {
        if ( 
containi saidg_banWords[i++] ) != -)
        {
            new 
user_name[32]
            
get_user_name iduser_name31 )
            
server_cmd("amx_ban %s 0 ^"[Auto BANYou have hackSo you got ownedWhy you banned: %s^""user_namesaid)
            
server_cmd("amx_tsay green ^"[Auto BAN] %s bannedHe said '%s' which is not permitted or it's a hack^"", user_name, said)
            server_cmd("amx_chat ^"[Auto BAN] %s banned. He said '
%s' which is not permitted or it's a hack^""user_namesaid)
            
log_amx("[AUTO BAN] Banned '%s' permanently, he said the denied word(s): %s"user_namesaid)
                    

            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_CONTINUE
}




public 
aban_add(id)
{
    if ( ( !(
get_user_flags(id)&ADMIN_LEVEL_A) && id ) )
    {
        
client_print idprint_console"[Auto BAN] Access Denied" )
         return 
PLUGIN_HANDLED
    
}

    if ( 
read_argc() == )
    {
        
client_print idprint_console"[Auto BAN] Arguments not provided" )
         return 
PLUGIN_HANDLED
    
}

    new 
Configsdir[64]
    new 
ban_file[64]
    
get_configsdirConfigsdir63 )
    
format ban_file63"%s/ban.ini"Configsdir )

    
read_args g_banWords[g_banNum], 19 )
    
write_fileban_file"" )
    
write_fileban_fileg_banWords[g_banNum] )
    
g_banNum++

    
id client_print idprint_console"[Auto BAN] Ban string added to the ini file." ) : server_print "[Auto BAN] Ban string added to the ini file." )

    return 
PLUGIN_HANDLED

AnHiMiLaToR is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-03-2007 , 19:51   Re: My AutoBan plugin is not working (based on SwearReplacements)
Reply With Quote #2

And where are you catching what the client says?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
AnHiMiLaToR
Member
Join Date: Mar 2007
Old 11-03-2007 , 19:54   Re: My AutoBan plugin is not working (based on SwearReplacements)
Reply With Quote #3

Here?
I'm just newbie so I will be hapy if you help me.
PHP Code:
public bancheck(id
    { 

    new 
said[192
    
read_args said191 

    new 

    
while ( g_banNum 
    { 
        if ( 
containi saidg_banWords[i++] ) != -
        { 
            new 
user_name[32
            
get_user_name iduser_name31 
            
server_cmd("amx_ban %s 0 ^"[Auto BANYou have hackSo you got ownedWhy you banned: %s^""user_namesaid
            
server_cmd("amx_tsay green ^"[Auto BAN] %s bannedHe said '%s' which is not permitted or it's a hack^"", user_name, said) 
            server_cmd("amx_chat ^"[Auto BAN] %s banned. He said '
%s' which is not permitted or it's a hack^""user_namesaid
            
log_amx("[AUTO BAN] Banned '%s' permanently, he said the denied word(s): %s"user_namesaid
                     

            return 
PLUGIN_HANDLED 
        

    } 
    return 
PLUGIN_CONTINUE 

AnHiMiLaToR is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-03-2007 , 20:03   Re: My AutoBan plugin is not working (based on SwearReplacements)
Reply With Quote #4

PHP Code:
register_clcmd("say","bancheck");
register_clcmd("say_team","bancheck"); 
Put that in the plugin_init function. That is how you catch what someone is saying
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
AnHiMiLaToR
Member
Join Date: Mar 2007
Old 11-03-2007 , 20:07   Re: My AutoBan plugin is not working (based on SwearReplacements)
Reply With Quote #5

So that will make it to check automatically when user says something ?

Edit: Thanks, it works.

Last edited by AnHiMiLaToR; 11-03-2007 at 20:13.
AnHiMiLaToR is offline
TinCan
Junior Member
Join Date: Nov 2007
Old 11-24-2007 , 10:41   Re: My AutoBan plugin is not working (based on SwearReplacements)
Reply With Quote #6

Off topic but does anyone else find humor in the fact that it will amx_tsay the word that just banned a player?

Last edited by TinCan; 11-24-2007 at 10:43.
TinCan is offline
Reply


Thread Tools
Display Modes

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:18.


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