搜索
查看: 1495|回复: 3

[求助]谁帮我写个插件

[复制链接]
发表于 2006-7-24 16:16:43 | 显示全部楼层 |阅读模式 来自 中国–广东–潮州
插件的用途是banIP,因为服务器的文件,别人可以解ban,我想要的是在插件里面加入IP,编译运行后实现ban他的IP。我用的是amx0.97,CS1.5!
:burn: :burn: :burn:
发表于 2006-7-24 17:59:53 | 显示全部楼层 来自 中国–湖北–襄阳

回复: [求助]谁帮我写个插件

#include <amxmod>

public plugin_init()
{
    register_plugin("KickIP", "0.0000001", "hohohoho~~~~")
}

public client_connect(id)
{
    if(file_exists("addons/amx/ip.txt"))
    {
        new ip[32]
        get_user_ip(id,ip,31,1)

        new text[32]
        new len = 0, line = 0
        while(read_file("addons/amx/ip.txt",line++,text,31,len))
        {
            if(text[0]==';') continue

            if(equal(ip, text))
            {
                return PLUGIN_CONTINUE
            }
        }
        server_cmd("kick #%d You cannot connect to this server!", get_user_userid(id))
    }
    return PLUGIN_CONTINUE
}
回复

使用道具 举报

 楼主| 发表于 2006-7-24 20:59:23 | 显示全部楼层 来自 中国–广东–潮州

回复: [求助]谁帮我写个插件

谢谢帮忙,测试去了。
回复

使用道具 举报

发表于 2006-7-25 08:45:59 | 显示全部楼层 来自 中国–广东–深圳–南山区

回复: [求助]谁帮我写个插件

原来写入文件可以是txt格式啊。哈哈
偶只见过INI:)
回复

使用道具 举报

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

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