搜索
查看: 2212|回复: 3

[AMXX 带源码] [发布]BAN在一定时间内retry的玩家-没钱下载Or需要源码

[复制链接]
发表于 2009-1-15 10:32:55 | 显示全部楼层 |阅读模式 来自 中国–湖北–黄冈
完全复制党。。
哈哈 反正看到他那个帖子的人说
源码是空的 骗子什么的
我就把源码给你们吧
下载
[local]1[/local]
不知道论坛前面有没有发布这个插件
我把这个插件传上来供大家分享.

一些玩家经常死了就retry,比较讨厌.这个插件的作用就是在一定的时间内
如果重复retry这个命令次数达到限制就BAN掉,对有OP权限的无效.

插件安装方法和其他插件一样.

下面是amxx.cfg配置:
amx_retryban = 1        //是否启用插件
amx_retrybanduration = 3
amx_retrychat = 1
amx_retrytimetoban = 10    //规定的一段时间为10分钟
amx_retrycounttoban = 2   //在规定的一段时间内重复retry 2次后就被BAN掉
amx_retrybankmsg = "Ban %s %m min(s) because retry %d times in %m2 min(s)"
amx_retrychatmsg = "You were using command RETRY %d time(s) in %d minute(s) so you has been banned from this server in %d minutes. Come back later please!"
  1. /* AMX Mod script.

  2. *

  3. * ========================Ban retry player Version 1.1============================

  4. *

  5. * (c) Copyright 2006, C@mp3R based on SYZo's AMX plugin

  6. * This file is provided as is (no warranties).

  7. *

  8. *

  9. *

  10. *        NEWS

  11. *        11 Jan 2006        

  12. *        - Add 2 new cvars

  13. *                amx_retrytimetoban

  14. *                amx_retrycounttoban : (if you retry "amx_retrycounttoban" times in "amx_retrytimetoban" minute(s), you will be banned)

  15. *        - Fixed ADMIN_IMMUNITY problem, now admin with access level a will not be banned

  16. *

  17. *        10 Jan 2006

  18. *        - Rename the plugin from no_reconnect to banretryplayer

  19. *        - Fixed the wrong spelling Embarassed

  20. *

  21. *

  22. *

  23. *        amx_retryban = 1

  24. *        amx_retrybanduration = 3

  25. *        amx_retrychat = 1

  26. *

  27. *        amx_retrytimetoban = 10

  28. *        amx_retrycounttoban = 2 (if you retry 3 times in amx_retrytimetoban minute(s), you will be banned)

  29. *        

  30. *        amx_retrybankmsg = "Ban %s %m min(s) because retry %d times in %m2 min(s)"

  31. *        amx_retrychatmsg = "You were using command RETRY %d time(s) in %d minute(s) so you has been banned from this server in %d minutes. Come back later please!"

  32. *

  33. */



  34. #include <amxmodx>

  35. #include <amxmisc>

  36. #define MAX_PLAYERS 32



  37. new pip[MAX_PLAYERS+1][22]

  38. new markedIp[MAX_PLAYERS+1]





  39. public client_connect(id) {

  40.     if ((!is_user_bot(id)) && ( !(get_user_flags(id) & ADMIN_IMMUNITY) ) && (get_cvar_num("amx_retryban")==1)) {



  41.         new userip[21+1]

  42.         new uname[33+1]

  43.         get_user_ip(id, userip, 21, 0)

  44.         get_user_name(id, uname, 33)

  45.         for(new i = 1; i <= MAX_PLAYERS; i++) {

  46.             if (equal(userip, pip[i], 21)) {

  47.                 new userid[1]

  48.                 userid[0] = get_user_userid(id)               

  49.                 if ( !(get_user_flags(id) & ADMIN_IMMUNITY) ) {            

  50.                     //--------------------------------------------

  51.                     if (markedIp[i] < get_cvar_num("amx_retrycounttoban"))

  52.                     {                        

  53.                         return PLUGIN_CONTINUE

  54.                     }

  55.                     //--------------------------------------------

  56.                     

  57.                     new txt[128]

  58.                     get_cvar_string("amx_retrybanmsg", txt, 127)

  59.                     new min[6]

  60.                     new min2[6]

  61.                     new retryCount[3]



  62.                     num_to_str(get_cvar_num("amx_retrybanduration"),min, 5)                                

  63.                     num_to_str(get_cvar_num("amx_retrytimetoban"),min2, 5)

  64.                     num_to_str(get_cvar_num("amx_retrycounttoban"),retryCount, 2)



  65.                     replace(txt, 127, "%s", uname)

  66.                     replace(txt, 127, "%m", min)        

  67.                     replace(txt, 127, "%m2", min2)

  68.                     replace(txt, 127, "%d", retryCount)

  69.                     

  70.                     server_cmd("say %s",txt)

  71.                     set_hudmessage(255, 0, 0, 0.05, 0.70, 0, 5.0, 6.0, 6.0, 0.15, 3)

  72.                     show_hudmessage(0,"%s",txt)                    

  73.                     

  74.                     if        (get_cvar_num("amx_retrychat")==1)

  75.                     {

  76.                         new sTemp[128]

  77.                         new text[128]

  78.                         get_cvar_string("amx_retrychatmsg", sTemp, 127)

  79.                         format(text, 128, sTemp, get_cvar_num("amx_retrycounttoban"), get_cvar_num("amx_retrytimetoban"), get_cvar_num("amx_retrybanduration"))

  80.                         client_cmd(id,"echo %s",text)

  81.                     }                    

  82.                     server_cmd("addip %d ^"%s^";wait;writeip",get_cvar_num("amx_retrybanduration"),userip)

  83.                     markedIp[i] = 0

  84.                     pip[i][0] = 0



  85.                 }

  86.                 return PLUGIN_CONTINUE

  87.             }

  88.         }

  89.         

  90.     }   

  91.     return PLUGIN_CONTINUE

  92. }



  93. public client_disconnect(id) {

  94.     if ((!is_user_bot(id)) && ( !(get_user_flags(id) & ADMIN_IMMUNITY) ) && (get_cvar_num("amx_retryban")==1)) {

  95.         for(new i = 1; i <= MAX_PLAYERS; i++) {

  96.             if(pip[i][0] == 0) {

  97.                 markedIp[i]++;

  98.                 server_print("say ----Markip[%d] = %d----", i, markedIp[i])

  99.                 //--------------------------------------------

  100.                 if (markedIp[i] == 1) // First time retry

  101.                 {               

  102.                         new para[3]

  103.                         format(para, 2, "%d", i)

  104.                         set_task(60.0 * get_cvar_num("amx_retrytimetoban"), "clean_markedip", 0, para, 1)                        

  105.                 }

  106.                 //----------------------------------        

  107.                 else if (markedIp[i] == get_cvar_num("amx_retrycounttoban"))  // Reached the retry time count

  108.                 {

  109.                         new userip[21+1]

  110.                         get_user_ip(id, userip, 21, 0)

  111.                         copy(pip[i], 21, userip)                        

  112.                 }

  113.                 return PLUGIN_CONTINUE

  114.             }

  115.         }

  116.     }

  117.     return PLUGIN_CONTINUE

  118. }

  119. public clean_markedip(index[]) {



  120.     markedIp[str_to_num(index)]=0;

  121. }





  122. public plugin_init() {

  123.         register_plugin("Ban retry player","1.1","C@mp3r.vn")  

  124.         register_cvar("amx_retryban","1")

  125.         register_cvar("amx_retrybanduration","3")

  126.         register_cvar("amx_retrychat","1")

  127.         register_cvar("amx_retrytimetoban","10")

  128.         register_cvar("amx_retrycounttoban","2")

  129.         

  130.         // %s is the player name, %m is amx_retrybanduration in minutes

  131.         

  132.         register_cvar("amx_retrybanmsg","Ban %s %m min(s) because retry %d time(s) in %m2 min(s)")

  133.         register_cvar("amx_retrychatmsg","You were using command RETRY %d time(s) in %d minute(s) so you has been banned from this server in %d minutes. Come back later please!")

  134.         for(new i=0; i< MAX_PLAYERS; i++)

  135.         {

  136.                 markedIp[i]=0;

  137.         }



  138.         return PLUGIN_CONTINUE

  139. }
复制代码
发表于 2009-1-16 03:02:15 | 显示全部楼层 来自 中国–安徽–合肥
用了! 没效果啊!
回复

使用道具 举报

发表于 2009-1-16 19:00:56 | 显示全部楼层 来自 中国–广西–百色
阁下还没完全改好,你应该汉化下~~
回复

使用道具 举报

发表于 2009-12-11 16:17:04 | 显示全部楼层 来自 中国–湖北–武汉
有能够限制OP VIP的吗??
OP VIP 老是进出进出的 普通玩家还好
回复

使用道具 举报

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

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