Raised This Month: $ Target: $400
 0% 

My AutoBan plugin is not working (based on SwearReplacements)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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