搜索
查看: 2638|回复: 5

求助屏蔽一些插件广告的代码!

[复制链接]
发表于 2009-1-15 00:25:40 | 显示全部楼层 |阅读模式 来自 广东深圳
最近在网上下载了一些插件,由于没有sma源文件,装上后,那个插件老是自动发一个网址。
有办法用插件来屏蔽掉这个自动发出的网址吗?
是client_print发出的
如果是玩家发出的,还可以判断,插件自己发出的,不知道如何捕捉才好。。。
发表于 2009-1-15 02:59:23 | 显示全部楼层 来自 广西百色

  1. /* AMX Mod Script.
  2. *
  3. * (c) Copyright 2002-2003, RAV
  4. * This file is provided as is (no warranties).
  5. *
  6. * Swearing will be filtered.
  7. *
  8. * Changelog:
  9. * 1.20 - Fixed some bugs
  10. * 1.10 - Initial Release
  11. */

  12. #include <amxmod>

  13. // max number of words in word list
  14. #define MAX_WORDS 64

  15. // Number of random messages.
  16. #define MESSAGES   4

  17. new g_messages[MESSAGES][] = {
  18. "三次警告內容!",
  19. "你再發廣告我就踢你出去!",
  20. "你再發廣告我就封你IP!",
  21. "你再發廣告我就長封你IP!"}  

  22. // file to read words from
  23. new g_wordList[] = "addons/amx/wordlist.txt"
  24. new g_swears[MAX_WORDS][32]
  25. new g_swearsNum
  26.   new count=0
  27. public plugin_init()
  28. {
  29.     register_plugin("Word_Auto_Ban","0.1","YanOnline")
  30.     register_clcmd("say","swearFilter")
  31.     register_clcmd("say_team","swearFilter")
  32.     register_cvar("amx_word_ban","60")
  33.      
  34.     if (file_exists(g_wordList))
  35.     {
  36.       new len, i = 0
  37.       while( read_file(g_wordList,i++,g_swears[g_swearsNum],31,len) )
  38.           if (len) ++g_swearsNum
  39.     }
  40.     else log_message("[AMX] Swear file not found (name ^"%s^")",g_wordList)
  41. }


  42. public swearFilter(id)
  43. {
  44.    new said[128],says[3],names[32],ips[16],bans[5]
  45.    read_args(said,127)
  46.   
  47.    for (new i=0; i<g_swearsNum; ++i)
  48.    {
  49.         if ( containi(said,g_swears[i]) != -1 )
  50.         {   
  51.             count=count+1
  52.             
  53.             if (count>3){
  54.             get_user_ip(id,ips,16)
  55.             
  56.             numtostr(get_cvar_num( "amx_word_ban"),bans,5)
  57.             client_print(0,print_center,"*公告:已經自動封[%s]%s分鐘!",ips,bans)
  58.             server_cmd("amx_ban %s %s",bans,ips)
  59.             count=0
  60.             }
  61.             get_user_name(id,names,31)
  62.             numtostr(count,says,3)
  63.           //  client_cmd(id,"say %s %s",says,g_messages[ random_num(0,MESSAGES-1) ])
  64.             if (count>0)
  65.             client_print(0,print_chat,"*第%s次警告[%s], %s",says,names,g_messages[count])
  66.             return PLUGIN_HANDLED
  67.         }
  68.    }
  69.    
  70.    return PLUGIN_CONTINUE
  71. }
复制代码
回复

使用道具 举报

发表于 2009-1-15 03:37:35 | 显示全部楼层 来自 四川遂宁
他说的是插件广告...
回复

使用道具 举报

 楼主| 发表于 2009-1-15 10:30:14 | 显示全部楼层 来自 广东深圳
谢谢野*人的回复,你那个代码是玩家发出的,那个广告插件应该是服务器自动发出的。
回复

使用道具 举报

发表于 2009-1-16 10:10:42 | 显示全部楼层 来自 广东中山
client_print发出的实在难搞,内置在插件里面,没有代码似乎无法去除。
尝试联系插件作者,请求修改。
说起来也是情有可原,这年头白吃的人太多,盗用他人成果的也很多,用这种方法保护自己,或者发插件不发源码,那是无奈之举,如果大家都好好尊重原作者,又何必如此?
回复

使用道具 举报

发表于 2010-3-14 20:01:05 | 显示全部楼层 来自 江苏苏州
/* AMX Mod Script.
*
* (c) Copyright 2002-2003, RAV
* This file is provided as is (no warranties).
*
* Swearing will be filtered.
*
* Changelog:
* 1.20 - Fixed some bugs
* 1.10 - Initial Release
*/

#include <amxmod>

// max number of words in word list
#define MAX_WORDS 64

// Number of random messages.
#define MESSAGES   4

new g_messages[MESSAGES][] = {
"三次警告內容!",
"你再發廣告我就踢你出去!",
"你再發廣告我就封你IP!",
"你再發廣告我就長封你IP!"}  

// file to read words from
new g_wordList[] = "addons/amx/wordlist.txt"
new g_swears[MAX_WORDS][32]
new g_swearsNum
  new count=0
public plugin_init()
{
    register_plugin("Word_Auto_Ban","0.1","YanOnline")
    register_clcmd("say","swearFilter")
    register_clcmd("say_team","swearFilter")
    register_cvar("amx_word_ban","60")
     
    if (file_exists(g_wordList))
    {
      new len, i = 0
      while( read_file(g_wordList,i++,g_swears[g_swearsNum],31,len) )
          if (len) ++g_swearsNum
    }
    else log_message("[AMX] Swear file not found (name ^"%s^")",g_wordList)
}


public swearFilter(id)
{
   new said[128],says[3],names[32],ips[16],bans[5]
   read_args(said,127)
  
   for (new i=0; i<g_swearsNum; ++i)
   {
        if ( containi(said,g_swears[i]) != -1 )
        {   
            count=count+1
            
            if (count>3){
            get_user_ip(id,ips,16)
            
            numtostr(get_cvar_num( "amx_word_ban"),bans,5)
            client_print(0,print_center,"*公告:已經自動封[%s]%s分鐘!",ips,bans)
            server_cmd("amx_ban %s %s",bans,ips)
            count=0
            }
            get_user_name(id,names,31)
            numtostr(count,says,3)
          //  client_cmd(id,"say %s %s",says,g_messages[ random_num(0,MESSAGES-1) ])
            if (count>0)
            client_print(0,print_chat,"*第%s次警告[%s], %s",says,names,g_messages[count])
            return PLUGIN_HANDLED
        }
   }
   
   return PLUGIN_CONTINUE
}
回复

使用道具 举报

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

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