|
发表于 2003-5-15 18:27:25
|
显示全部楼层
来自 中国–湖南–长沙
amx_nextmap是通过调了function来实现的:
//打开mapcyclefile来获得nextmap。
find_nextmap() {
new filename[64], currentmap[64], buffor[64]
new firstmap[64], state = 0, index = 0, len
get_cvar_string("mapcyclefile",filename,63)
get_mapname(currentmap,63)
if (file_exists(filename)){
while(read_file(filename,index++,buffor,63,len)){
if (is_alpha(buffor[0])&&is_map_valid(buffor)){
if (state == 0){
state = 1
copy(firstmap,63,buffor)
}
if (equali(currentmap,buffor)){
state = 2
continue
}
if (state == 2) {
copy(nextmap,63,buffor)
state = 3
break
}
}
}
}
if (state == 0)
copy(nextmap,63,currentmap)
else if (state < 3)
copy(nextmap,63,firstmap)
set_cvar_string("amx_nextmap",nextmap)
}
//进入server即可触发clcms say nextmap。
public plugin_init() {
register_plugin("NextMap","0.9.2","default")
register_event("30", "admin_forcemap", "a")
register_clcmd("say nextmap","admin_nextmap",0,"- displays nextmap")
register_cvar("amx_nextmap","",FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)
find_nextmap()
return PLUGIN_CONTINUE
}
由此看来我觉得在tips里加nextmap应该是有可能的。 |
|