搜索
查看: 2356|回复: 5

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

[复制链接]
发表于 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 | 显示全部楼层 来自 中国–福建–宁德
我是菜鸟,友情帮楼主顶一下。
回复

使用道具 举报

 楼主| 发表于 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[MAX_PLAYERS+1]
new g_nCurWeapon[MAX_PLAYERS][2]
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[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(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[i] = 0
                }
        }
}
回复

使用道具 举报

发表于 2009-8-23 01:24:06 | 显示全部楼层 来自 中国–福建–漳州
  1. /* Plugin generated by AMXX-Studio */

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

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

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


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


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


  20. Required modules
  21. #include <amxmodx>
  22. #include <amxmisc>

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


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

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

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

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


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

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

  49. #include <amxmodx>
  50. #include <amxmisc>

  51. #define PLUGIN "Anti FastFire"
  52. #define VERSION "1.1"
  53. #define AUTHOR "DarkSnow" //Respect ;)

  54. #pragma tabsize 0
  55. #define MAX_PLAYERS 32

  56. new countBullets[MAX_PLAYERS+1]
  57. new g_nCurWeapon[MAX_PLAYERS][2]
  58. new g_MaxPlayers

  59. public plugin_init()
  60. {
  61.         register_plugin(PLUGIN, VERSION, AUTHOR)
  62.        
  63.         register_event( "CurWeapon", "Event_ShotFired",  "b" )
  64.         register_cvar("amx_af_max","16")
  65.         register_cvar("amx_af","1")
  66.         set_task(1.0, "checkBulletCount",127,_,_,"b")
  67. }

  68. public Event_ShotFired( id )
  69. {
  70.         new weaponID = read_data( 2 )
  71.         new wAmmo = read_data( 3 )

  72.         g_MaxPlayers = get_maxplayers()
  73.        
  74.         if( g_nCurWeapon[id-1][0] != weaponID ) // User Changed Weapons..
  75.         {
  76.                 g_nCurWeapon[id-1][0] = weaponID
  77.                 g_nCurWeapon[id-1][1] = wAmmo
  78.                 return PLUGIN_CONTINUE
  79.         }
  80.         if( g_nCurWeapon[id-1][1] < wAmmo ) // User Reloaded..
  81.         {
  82.                 g_nCurWeapon[id-1][1] = wAmmo
  83.                 return PLUGIN_CONTINUE
  84.         }
  85.         if( g_nCurWeapon[id-1][1] == wAmmo ) // User did something else, but didn't shoot..
  86.                 return PLUGIN_CONTINUE
  87.         g_nCurWeapon[id-1][1] = wAmmo
  88.         g_nCurWeapon[id-1][0] = weaponID

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

  90.         return PLUGIN_CONTINUE
  91. }  

  92. public checkBulletCount()
  93. {
  94.         if (get_cvar_num("amx_af") == 1)
  95.         {
  96.                 for(new i=1;i<=g_MaxPlayers;i++)
  97.                 {
  98.                         if(is_user_alive(i))
  99.                         {
  100.                                 //client_print(i,print_chat,"%i",countBullets[i])
  101.                                 if (countBullets[i] > get_cvar_num("amx_af_max"))
  102.                                 {
  103.                                         new Authid[35],Name[32],CurrentTime[29],Map[32],ping,loss,Message[256]
  104.                                         //client_print(0,print_chat,"%i",countBullets[i])
  105.                                         get_user_name(i,Name,31)
  106.                                         get_user_authid(i,Authid,34)
  107.                                         get_mapname(Map,31)
  108.                                         get_user_ping(i,ping,loss)
  109.                                         get_time("%d/%m-%Y - %H:%M:%S",CurrentTime,29)
  110.                                        
  111.                                         format(Message,255,"[Anti FastFire %s - %s] %s<%s> using FastFire type of cheat (Ping: %d )",CurrentTime,Map,Name,Authid,ping)
  112.                                         log_amx(Message)

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

  114.                                         server_cmd("amx_banip #%d ^"Banned becuse of cheats^"", get_user_userid(i));
  115.                                 }
  116.                         }
  117.                         countBullets[i] = 0
  118.                 }
  119.         }
  120. }
复制代码
回复

使用道具 举报

 楼主| 发表于 2009-8-23 01:48:00 | 显示全部楼层 来自 中国–广东–深圳–南山区
;P感谢R版主多次帮助
回复

使用道具 举报

发表于 2009-8-26 13:23:20 | 显示全部楼层 来自 中国–湖南–株洲
market。。。
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表