搜索
查看: 9964|回复: 58

【插件】服务器维护提示

[复制链接]
发表于 2005-11-15 05:12:19 | 显示全部楼层 |阅读模式 来自 中国–北京–北京–通州区
很多服务器的管理员都遇到过这样的问题,当服务器需要临时下线维护的时,看到N多在线的玩家总感到茫然,这样的情况直接在控制台中输入EXIT好像很不符合常理,叫大家无缘无故就掉线了很难和玩家们解释!于是发布这样一个插件!实现服务器临时维护提示功能。

插件内容见二楼

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
 楼主| 发表于 2005-11-15 05:16:24 | 显示全部楼层 来自 中国–北京–北京–通州区

回复: 【插件】服务器维护提示

#include <amxmodx>
#include <amxmisc>


public plugin_init() {
        register_plugin("关闭服务器", "1.1", "Remo Williams")
        register_concmd("amx_exit","servershutdown",ADMIN_IMMUNITY," - 服务器10秒退出提示")
}


public servershutdown(id) {
        if (!(get_user_flags(id)&ADMIN_LEVEL_A)) {
                console_print(id,"[注意] 你没有足够的权限使用该命令.")
                return PLUGIN_HANDLED
        }
        set_task(0.0,"alert")
        set_task(3.0,"ten")
        set_task(4.0,"nine")
        set_task(5.0,"eight")
        set_task(6.0,"seven")
        set_task(7.0,"six")
        set_task(8.0,"five")
        set_task(9.0,"four")
        set_task(10.0,"three")
        set_task(11.0,"two")
        set_task(12.0,"one")
        set_task(13.0,"zero")
        set_task(17.0,"exit_server")

        return PLUGIN_HANDLED
}

public alert() {
        client_print(0,print_chat,"***** 注意! 服务器临时维护!请大家稍候登陆! *****")
        server_print("***** ALERT! SERVER RESTART!*****")
        client_cmd(0,"spk ^"fvox/warning.wav^"")
}

public ten() {
        client_print(0,print_chat,"服务器将在 10 秒后关闭....")
        server_print("Server Shutdown in 10....")
        client_cmd(0,"spk ^"fvox/ten.wav^"")
}

public nine() {
        client_print(0,print_chat,"服务器将在 9 秒后关闭....")
        server_print("Server Shutdown in 9....")
        client_cmd(0,"spk ^"fvox/nine.wav^"")
}

public eight() {
        client_print(0,print_chat,"服务器将在 8 秒后关闭....")
        server_print("Server Shutdown in 8....")

        client_cmd(0,"spk ^"fvox/eight.wav^"")
}

public seven() {
        client_print(0,print_chat,"服务器将在 7 秒后关闭....")
        server_print("Server Shutdown in 7....")

        client_cmd(0,"spk ^"fvox/seven.wav^"")
}

public six() {
        client_print(0,print_chat,"服务器将在 6 秒后关闭....")
        server_print("Server Shutdown in 6....")

        client_cmd(0,"spk ^"fvox/six.wav^"")
}

public five() {
        client_print(0,print_chat,"服务器将在 5 秒后关闭....")
        server_print("Server Shutdown in 5....")

        client_cmd(0,"spk ^"fvox/five.wav^"")
}

public four() {
        client_print(0,print_chat,"服务器将在 4 秒后关闭....")
        server_print("Server Shutdown in 4....")

        client_cmd(0,"spk ^"fvox/four.wav^"")
}

public three() {
        client_print(0,print_chat,"服务器将在 3 秒后关闭....")
        server_print("Server Shutdown in 3....")

        client_cmd(0,"spk ^"fvox/three.wav^"")
}

public two() {
        client_print(0,print_chat,"服务器将在 2 秒后关闭....")
        server_print("Server Shutdown in 2....")

        client_cmd(0,"spk ^"fvox/two.wav^"")
}

public one() {
        client_print(0,print_chat,"服务器将在 1 秒后关闭....")
        server_print("Server Shutdown in 1....")

        client_cmd(0,"spk ^"fvox/one.wav^"")
}

public zero() {
        client_print(0,print_chat,"服务器关闭 请大家稍候....")
        server_print("Server Shutting Down!")

        client_cmd(0,"spk ^"fvox/safe_day.wav^"")
}

public exit_server() {
        client_cmd(0,"retry",1.5)
        server_cmd("quit")
}


以上为插件代码 保存为UTF-8格式后 直接编译即可

运行命令为amx_exit 之后所有在线玩家都会看到关服提示,倒数秒并伴有语音提示。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
回复

使用道具 举报

发表于 2005-11-15 08:11:40 | 显示全部楼层 来自 中国–云南–曲靖

回复: 【插件】服务器维护提示

我绝对支持您,,,,我买!一定要买!
回复

使用道具 举报

发表于 2005-11-15 13:02:03 | 显示全部楼层 来自 中国–广东–佛山–顺德区

回复: 【插件】服务器维护提示

又要钱!!!还没储够!!!
回复

使用道具 举报

发表于 2005-11-15 14:48:53 | 显示全部楼层 来自 中国–广东–广州–天河区

回复: 【插件】服务器维护提示

如果是这样,一般我会建个CFG文件,里面写着 say *服务器需要维护,请10秒后重进...

重复
exec re.cfg

这样即可

如果是测试插件需要可以另开一个有密码的F,自己调试!
回复

使用道具 举报

 楼主| 发表于 2005-11-15 15:24:16 | 显示全部楼层 来自 中国–北京–北京–通州区

回复: 【插件】服务器维护提示

Post by yanexp
如果是这样,一般我会建个CFG文件,里面写着 say *服务器需要维护,请10秒后重进...

重复
exec re.cfg

这样即可

如果是测试插件需要可以另开一个有密码的F,自己调试!


单纯发公告的话用HLSW不是更简单!我说的是在hlds模式下直接输入退出命令而玩家可以得到退出提示。
回复

使用道具 举报

发表于 2005-11-15 22:25:19 | 显示全部楼层 来自 中国–福建–莆田

回复: 【插件】服务器维护提示

我想要啊,不知道什么用啊
回复

使用道具 举报

发表于 2005-11-24 14:28:32 | 显示全部楼层 来自 中国–北京–北京

回复: 【插件】服务器维护提示

这个是好东西啊~买一个研究一下~~
回复

使用道具 举报

发表于 2005-11-24 15:25:00 | 显示全部楼层 来自 中国–广东–惠州–博罗县

回复: 【插件】服务器维护提示

买是买了,可是怎么用啊?是不是把文件放到插件文件夹后直接在INI文件里添加就行了?
回复

使用道具 举报

发表于 2005-11-24 15:26:46 | 显示全部楼层 来自 中国–广东–惠州–博罗县

回复: 【插件】服务器维护提示

怎么用了没效果呀?是不是还有什么要设置的呢??
回复

使用道具 举报

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

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