702033080 发表于 2009-8-22 21:51:20

请各位会修改源码的高手帮忙修改下

本帖最后由 702033080 于 2009-8-22 21:53 编辑

这个插件就是检测暴力加速的..但是这个插件只会kick..然后写一个banned.cfg来..而且写了只是banid而已 banid 0.0 VALVE_ID_LAN
请各位帮忙修改下..修改成检测到之后用amx ban掉ip..谢谢各位帮忙

玮玮来啦 发表于 2009-8-22 22:22:51

我是菜鸟,友情帮楼主顶一下。

702033080 发表于 2009-8-22 22:24:37

我也是菜鸟.
我修改了下..但是还是没用..只是写了个banned而已

源码如下

/* Plugin generated by AMXX-Studio */

/*
Anti FastFire v1.0 by DarkSnow
This plugin will detect and ban cheaters using external application that screw up the tick counter for cs,
thus allowing nearly unlimmited speed in certain aspects. These cheaters may deplete a whole M249(machinegun)
in just a second. You have seen em, i have seen em - everyone have been disturbed by these cheaters.

Id like to point out that this is my second plugin and i would aprishiate any feedback on how you find
it usefull, if it works, how i may improve this plugin etc.

This plugin, just as my previous "Anti SpeedHack" plugin work to 100% with VAC2. It is untested with any
other forms of anti cheat but should run just fine.


Controll
There are 2 cvars;
"amx_af_max" | def.val=16 - Defines the maximum Bp/S a player may spray before ban
"amx_af" | def.val=1 - Activates or deactivates Anti FastFire where 1=On ; 0=Off


The Works
Just like my previous plugin, this one is just equaly simple. Basicly, all this plugin does is to cound how
many bullets per second (which we futher will call Bp/S) a player is currently spraying. If a players Bp/S
exeeds a certain value the plugin will administer a ban on that player, save a log entry and publicly announce
that the player have cheated.


Required modules
#include <amxmodx>
#include <amxmisc>

Is the plugin safe to use?
Yes, this script unlike my previous is very secure. You can trust this script to 100%. As refference,
i have also included in the readme file the complete list of all Bp/S values for all buyable weapons in CS.


WARNING!
If this program makes your milk in the fridge sour, kidnaps the u.s pressident (mr. george w bush jr aka
"sexual_animal" on various forums) and leaves a random note in your name to the secret service, starts
ww3 or anything unwanted - dont blaim me. In other words, by using this you agree to not sue me or any
similar B.S if anything goes wrong.
Common, im busting my ass doing this crapp and you want to break my legs just for the sake of it not working
propperly? If you dont like it, if it does not work - dont use it.

WARNING #2
I have not 100% tested it since the program i used to speed up the CS client also speeded up the dedicated
server equaly making it impossible for the server to know any timely difference. Im truly sory about that,
but as of right now i cant setup any other server so im hoping someone with the resources of doing so
will send me feedback about how it went.

You can speed up CS with the following application:
http://www.foredu.com/speed_up/

Sorry about posting a link to a application that may be used as a cheat, but its better to deal with a
problem instead of pretending it does not exists - right?


Credits
XxAvalanchexX - For posting most of what i made my codebase (http://www.amxmodx.org/forums/viewtopic.php?t=17725)
... and your truly, DarkSnow

Please send me any feedback, questions ect either on amxx forums (http://www.amxmodx.org/forums) or;
mathias.frendin@telia.com - mail/msn
-DarkSnow
*/

#include <amxmodx>
#include <amxmisc>

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

#pragma tabsize 0
#define MAX_PLAYERS 32

new countBullets
new g_nCurWeapon
new g_MaxPlayers

public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR)
       
        register_event( "CurWeapon", "Event_ShotFired","b" )
        register_cvar("amx_af_max","16")
        register_cvar("amx_af","1")
        set_task(1.0, "checkBulletCount",127,_,_,"b")
}

public Event_ShotFired( id )
{
        new weaponID = read_data( 2 )
        new wAmmo = read_data( 3 )

        g_MaxPlayers = get_maxplayers()
       
        if( g_nCurWeapon != weaponID ) // User Changed Weapons..
        {
                g_nCurWeapon = weaponID
                g_nCurWeapon = wAmmo
                return PLUGIN_CONTINUE
        }
        if( g_nCurWeapon < wAmmo ) // User Reloaded..
        {
                g_nCurWeapon = wAmmo
                return PLUGIN_CONTINUE
        }
        if( g_nCurWeapon == wAmmo ) // User did something else, but didn't shoot..
                return PLUGIN_CONTINUE
        g_nCurWeapon = wAmmo
        g_nCurWeapon = weaponID

        countBullets++ //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)
                                if (countBullets > get_cvar_num("amx_af_max"))
                                {
                                        new Authid,Name,CurrentTime,Map,ping,loss,Message
                                        //client_print(0,print_chat,"%i",countBullets)
                                        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," %s<%s> using FastFire type of cheat (Ping: %d )",CurrentTime,Map,Name,Authid,ping)
                                        log_amx(Message)

                                        client_print(0, print_chat, "%s 垃圾在用暴力作弊器",Name)

                                        server_cmd("封禁 #%d 封禁原因:你正在使用暴力作弊器.By:Kana",get_user_userid(i))
                                        server_cmd("amx_ban %s 0",Authid)
                                        server_cmd("writeid")
                                }
                        }
                        countBullets = 0
                }
        }
}

Rulzy 发表于 2009-8-23 01:24:06

/* Plugin generated by AMXX-Studio */

/*
Anti FastFire v1.0 by DarkSnow
This plugin will detect and ban cheaters using external application that screw up the tick counter for cs,
thus allowing nearly unlimmited speed in certain aspects. These cheaters may deplete a whole M249(machinegun)
in just a second. You have seen em, i have seen em - everyone have been disturbed by these cheaters.

Id like to point out that this is my second plugin and i would aprishiate any feedback on how you find
it usefull, if it works, how i may improve this plugin etc.

This plugin, just as my previous "Anti SpeedHack" plugin work to 100% with VAC2. It is untested with any
other forms of anti cheat but should run just fine.


Controll
There are 2 cvars;
"amx_af_max" | def.val=16 - Defines the maximum Bp/S a player may spray before ban
"amx_af" | def.val=1 - Activates or deactivates Anti FastFire where 1=On ; 0=Off


The Works
Just like my previous plugin, this one is just equaly simple. Basicly, all this plugin does is to cound how
many bullets per second (which we futher will call Bp/S) a player is currently spraying. If a players Bp/S
exeeds a certain value the plugin will administer a ban on that player, save a log entry and publicly announce
that the player have cheated.


Required modules
#include <amxmodx>
#include <amxmisc>

Is the plugin safe to use?
Yes, this script unlike my previous is very secure. You can trust this script to 100%. As refference,
i have also included in the readme file the complete list of all Bp/S values for all buyable weapons in CS.


WARNING!
If this program makes your milk in the fridge sour, kidnaps the u.s pressident (mr. george w bush jr aka
"sexual_animal" on various forums) and leaves a random note in your name to the secret service, starts
ww3 or anything unwanted - dont blaim me. In other words, by using this you agree to not sue me or any
similar B.S if anything goes wrong.
Common, im busting my ass doing this crapp and you want to break my legs just for the sake of it not working
propperly? If you dont like it, if it does not work - dont use it.

WARNING #2
I have not 100% tested it since the program i used to speed up the CS client also speeded up the dedicated
server equaly making it impossible for the server to know any timely difference. Im truly sory about that,
but as of right now i cant setup any other server so im hoping someone with the resources of doing so
will send me feedback about how it went.

You can speed up CS with the following application:
http://www.foredu.com/speed_up/

Sorry about posting a link to a application that may be used as a cheat, but its better to deal with a
problem instead of pretending it does not exists - right?


Credits
XxAvalanchexX - For posting most of what i made my codebase (http://www.amxmodx.org/forums/viewtopic.php?t=17725)
... and your truly, DarkSnow

Please send me any feedback, questions ect either on amxx forums (http://www.amxmodx.org/forums) or;
mathias.frendin@telia.com - mail/msn
-DarkSnow
*/

#include <amxmodx>
#include <amxmisc>

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

#pragma tabsize 0
#define MAX_PLAYERS 32

new countBullets
new g_nCurWeapon
new g_MaxPlayers

public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR)
       
        register_event( "CurWeapon", "Event_ShotFired","b" )
        register_cvar("amx_af_max","16")
        register_cvar("amx_af","1")
        set_task(1.0, "checkBulletCount",127,_,_,"b")
}

public Event_ShotFired( id )
{
        new weaponID = read_data( 2 )
        new wAmmo = read_data( 3 )

        g_MaxPlayers = get_maxplayers()
       
        if( g_nCurWeapon != weaponID ) // User Changed Weapons..
        {
                g_nCurWeapon = weaponID
                g_nCurWeapon = wAmmo
                return PLUGIN_CONTINUE
        }
        if( g_nCurWeapon < wAmmo ) // User Reloaded..
        {
                g_nCurWeapon = wAmmo
                return PLUGIN_CONTINUE
        }
        if( g_nCurWeapon == wAmmo ) // User did something else, but didn't shoot..
                return PLUGIN_CONTINUE
        g_nCurWeapon = wAmmo
        g_nCurWeapon = weaponID

        countBullets++ //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)
                                if (countBullets > get_cvar_num("amx_af_max"))
                                {
                                        new Authid,Name,CurrentTime,Map,ping,loss,Message
                                        //client_print(0,print_chat,"%i",countBullets)
                                        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," %s<%s> using FastFire type of cheat (Ping: %d )",CurrentTime,Map,Name,Authid,ping)
                                        log_amx(Message)

                                        client_print(0, print_chat, "%s using cheat, detected and banned by Anti FastFire plugin by DarkSnow",Name)

                                        server_cmd("amx_banip #%d ^"Banned becuse of cheats^"", get_user_userid(i));
                                }
                        }
                        countBullets = 0
                }
        }
}

702033080 发表于 2009-8-23 01:48:00

;P感谢R版主多次帮助

savasun 发表于 2009-8-26 13:23:20

market。。。
页: [1]
查看完整版本: 请各位会修改源码的高手帮忙修改下