Raised This Month: $ Target: $400
 0% 

Double command using problem[anti-fastfire+advanced_bans]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Metanabol
Member
Join Date: Feb 2009
Old 02-18-2009 , 09:15   Double command using problem[anti-fastfire+advanced_bans]
Reply With Quote #1

Hello i slightly edited ant_fastfire 1.2v for working with advanced bans. But script for fast fire bans 2 times, sometimes 3times... so my question is how to stop this command for banned player, after advanced_bans banip for 1 hour ? here is code:

PHP Code:
public checkBulletCount()
{
    if (
get_cvar_num("amx_af") == 1)
    {
        for(new 
i=1;i<=g_MaxPlayers;i++)
        {
            if(
is_user_alive(i))
            {
                
//client_print(i,print_chat,"%i",countBullets[i])
                
if (countBullets[i] > get_cvar_num("amx_af_max"))
                {
                    new 
Authid[35],Name[32],CurrentTime[29],Map[32],ping,loss,Message[256]
                    
//client_print(0,print_chat,"%i",countBullets[i])
                    
get_user_name(i,Name,31)
                    
get_user_authid(i,Authid,34)
                    
get_mapname(Map,31)
                    
get_user_ping(i,ping,loss)
                    
get_time("%d/%m-%Y - %H:%M:%S",CurrentTime,29)
                    
                    
format(Message,255,"[Anti FastFire %s - %s] %s<%s> using FastFire type of cheat (Ping: %d )",CurrentTime,Map,Name,Authid,ping)
                    
log_amx(Message)

                    
client_print(0print_chat"%s booted by AF plugin.",Name)

                    if (
get_cvar_num("amx_af") == 1)
                    {
                        
server_cmd("amx_banip #%d 60 ^"[AC]FAST-FIRE Detected.^"",get_user_userid(i))
                    }
                    else
                    {
                        
server_cmd("amx_banip #%d 60 ^"[AC]FAST-FIRE Detected.^"",get_user_userid(i))
                    }
                }
            }
            
countBullets[i] = 0
        
}
    }


Last edited by Metanabol; 02-18-2009 at 09:17.
Metanabol is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-18-2009 , 10:11   Re: Double command using problem[anti-fastfire+advanced_bans]
Reply With Quote #2

when checkBulletCount(); is called?
__________________
xPaw is offline
Metanabol
Member
Join Date: Feb 2009
Old 02-18-2009 , 15:13   Re: Double command using problem[anti-fastfire+advanced_bans]
Reply With Quote #3

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Anti FastFire"
#define VERSION "1.2"
#define AUTHOR "DarkSnow" //Respect ;)

#pragma tabsize 0
#define MAX_PLAYERS 32 

new countBullets[MAX_PLAYERS+1]
new 
g_amxban
new g_nCurWeapon[MAX_PLAYERS][2]
new 
g_MaxPlayers

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event"CurWeapon""Event_ShotFired",  "b" )
    
register_cvar("amx_af_max","17")
    
register_cvar("amx_af","1")
    
register_cvar("amx_af_amxban""1"//dissabled by default
    
register_cvar("amx_af_bantime""60")
    
set_task(1.0"checkBulletCount",127,_,_,"b")
}

public 
Event_ShotFiredid 

    new 
weaponID read_data
    new 
wAmmo read_data

    
g_MaxPlayers get_maxplayers()
    
    if( 
g_nCurWeapon[id-1][0] != weaponID // User Changed Weapons.. 
    

        
g_nCurWeapon[id-1][0] = weaponID 
        g_nCurWeapon
[id-1][1] = wAmmo 
        
return PLUGIN_CONTINUE 
    

    if( 
g_nCurWeapon[id-1][1] < wAmmo // User Reloaded.. 
    

        
g_nCurWeapon[id-1][1] = wAmmo 
        
return PLUGIN_CONTINUE 
    

    if( 
g_nCurWeapon[id-1][1] == wAmmo // User did something else, but didn't shoot.. 
        
return PLUGIN_CONTINUE 
    g_nCurWeapon
[id-1][1] = wAmmo 
    g_nCurWeapon
[id-1][0] = weaponID 

    countBullets
[id]++ //Counting the bullets, one by one, all day long :)

    
return PLUGIN_CONTINUE 
}  

public 
checkBulletCount()
{
    if (
get_cvar_num("amx_af") == 1)
    {
        for(new 
i=1;i<=g_MaxPlayers;i++)
        {
            if(
is_user_alive(i))
            {
                
//client_print(i,print_chat,"%i",countBullets[i])
                
if (countBullets[i] > get_cvar_num("amx_af_max"))
                {
                    new 
Authid[35],Name[32],CurrentTime[29],Map[32],ping,loss,Message[256]
                    
//client_print(0,print_chat,"%i",countBullets[i])
                    
get_user_name(i,Name,31)
                    
get_user_authid(i,Authid,34)
                    
get_mapname(Map,31)
                    
get_user_ping(i,ping,loss)
                    
get_time("%d/%m-%Y - %H:%M:%S",CurrentTime,29)
                    
                    
format(Message,255,"[Anti FastFire %s - %s] %s<%s> using FastFire type of cheat (Ping: %d )",CurrentTime,Map,Name,Authid,ping)
                    
log_amx(Message)

                    
client_print(0print_chat"%s booted by AF plugin.",Name)

                    if (
get_cvar_num("amx_af") == 1)
                    {
                        
server_cmd("amx_banip #%d 60 ^"[AC]FAST-FIRE Detected.^"",get_user_userid(i))
                    }
                    else
                    {
                        
server_cmd("amx_banip #%d 60 ^"[AC]FAST-FIRE Detected.^"",get_user_userid(i))
                    }
                }
            }
            
countBullets[i] = 0
        
}
    }

here is all code. please help me fix that ;)
Metanabol is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-19-2009 , 19:34   Re: Double command using problem[anti-fastfire+advanced_bans]
Reply With Quote #4

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Anti FastFire"
#define VERSION "1.2"
#define AUTHOR "DarkSnow" //Respect ;)

#pragma tabsize 0
#define MAX_PLAYERS 32 

new countBullets[MAX_PLAYERS+1]
new 
g_amxban
new g_nCurWeapon[MAX_PLAYERS][2]
new 
g_MaxPlayers
new bool:g_banned[MAX_PLAYERS+1]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event"CurWeapon""Event_ShotFired",  "b" )
    
register_cvar("amx_af_max","17")
    
register_cvar("amx_af","1")
    
register_cvar("amx_af_amxban""1"//dissabled by default
    
register_cvar("amx_af_bantime""60")
    
set_task(1.0"checkBulletCount",127,_,_,"b")
}

public 
client_disconnect(client)
{
    
g_banned[client] = false;
}

public 
Event_ShotFiredid 

    if( 
g_banned[id] ) return PLUGIN_CONTINUE;
    
    new 
weaponID read_data
    new 
wAmmo read_data

    
g_MaxPlayers get_maxplayers()
    
    if( 
g_nCurWeapon[id-1][0] != weaponID // User Changed Weapons.. 
    

        
g_nCurWeapon[id-1][0] = weaponID 
        g_nCurWeapon
[id-1][1] = wAmmo 
        
return PLUGIN_CONTINUE 
    

    if( 
g_nCurWeapon[id-1][1] < wAmmo // User Reloaded.. 
    

        
g_nCurWeapon[id-1][1] = wAmmo 
        
return PLUGIN_CONTINUE 
    

    if( 
g_nCurWeapon[id-1][1] == wAmmo // User did something else, but didn't shoot.. 
        
return PLUGIN_CONTINUE 
    g_nCurWeapon
[id-1][1] = wAmmo 
    g_nCurWeapon
[id-1][0] = weaponID 

    countBullets
[id]++ //Counting the bullets, one by one, all day long :)

    
return PLUGIN_CONTINUE 
}  

public 
checkBulletCount()
{
    if (
get_cvar_num("amx_af") == 1)
    {
        for(new 
i=1;i<=g_MaxPlayers;i++)
        {
            if(!
g_banned[i] && is_user_alive(i))
            {
                
//client_print(i,print_chat,"%i",countBullets[i])
                
if (countBullets[i] > get_cvar_num("amx_af_max"))
                {
                    new 
Authid[35],Name[32],CurrentTime[29],Map[32],ping,loss,Message[256]
                    
//client_print(0,print_chat,"%i",countBullets[i])
                    
get_user_name(i,Name,31)
                    
get_user_authid(i,Authid,34)
                    
get_mapname(Map,31)
                    
get_user_ping(i,ping,loss)
                    
get_time("%d/%m-%Y - %H:%M:%S",CurrentTime,29)
                    
                    
format(Message,255,"[Anti FastFire %s - %s] %s<%s> using FastFire type of cheat (Ping: %d )",CurrentTime,Map,Name,Authid,ping)
                    
log_amx(Message)

                    
client_print(0print_chat"%s booted by AF plugin.",Name)

                    if (
get_cvar_num("amx_af") == 1)
                    {
                        
server_cmd("amx_banip #%d 60 ^"[AC]FAST-FIRE Detected.^"",get_user_userid(i))
                    }
                    else
                    {
                        
server_cmd("amx_banip #%d 60 ^"[AC]FAST-FIRE Detected.^"",get_user_userid(i))
                    }
                    
                    
g_banned[i] = true;
                }
            }
            
countBullets[i] = 0
        
}
    }

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Metanabol
Member
Join Date: Feb 2009
Old 02-20-2009 , 14:17   Re: Double command using problem[anti-fastfire+advanced_bans]
Reply With Quote #5

Thank you very much.
Metanabol 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 17:07.


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