|
楼主 |
发表于 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 之后所有在线玩家都会看到关服提示,倒数秒并伴有语音提示。 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|