|
发表于 2004-8-7 18:25:52
|
显示全部楼层
来自 中国–陕西–西安
先声明:随便写了个,编译的时候有warning,但可以生成amx文件,没有测试过
在这里只发布源代码,自己复制编译
免责声明:
我注明了beta,不知道是否有效,使用不使用你们自己选择,使用中如出现什么问题与我无关
=====================================================
#include <amxmod>
new lan = 0
new freq_1 = 820
new freq_0 = 60
public plugin_init() {
register_plugin("auto sv_lan","0.1beta","nwb13")
register_cvar("amx_auto_sv_lan","1")
set_task(15,"sv_lan_1",54321)
}
public sv_lan_1() {
if (get_cvar_num("amx_auto_sv_lan")) {
if (get_cvar_num("sv_lan")){
set_task(freq_1,"sv_lan_0",54322)
remove_task(54321)
}else{
lan = 1
server_cmd("sv_lan %d",lan)
server_print("sv_lan has change to %d auto",lan)
}
}else
return PLUGIN_HANDLED
}
public sv_lan_0() {
if (get_cvar_num("amx_auto_sv_lan")) {
if (get_cvar_num("sv_lan")){
lan = 0
server_cmd("sv_lan %d",lan)
server_print("sv_lan has change to %d auto",lan)
}else{
set_task(freq_0,"sv_lan_1",54321)
remove_task(54322)
}
}else
return PLUGIN_HANDLED
} |
|