|
楼主 |
发表于 2008-3-6 22:17:13
|
显示全部楼层
来自 中国–广西–柳州–柳北区
回复: 求一个立即暂停CS服务器游戏的代码,谢谢。
谢谢,用server_cmd ("pause")测试但还是无效果,我做这个插件的用途是每局警察或土匪胜利就暂停一秒,我注意到一般服务器自动踢人就是开局踢,所以才想到每局结束暂停让数据缓冲一下看能解决不,在admin_cmd.sma里找到这样一段,代码不是很懂,请问哪句才是关键暂停呢?Thank You。public cmdPause(id, level, cid)
{
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED
new authid[32], name[32], slayer = id
get_user_authid(id, authid, 31)
get_user_name(id, name, 31)
g_pausAble = get_cvar_float("pausable")
if (!slayer)
slayer = find_player("h")
if (!slayer)
{
console_print(id, "[AMXX] %L", id, "UNABLE_PAUSE")
return PLUGIN_HANDLED
}
set_cvar_float("pausable", 1.0)
client_cmd(slayer, "pause;pauseAck")
log_amx("Cmd: ^"%s<%d><%s><>^" %s server", name, get_user_userid(id), authid, g_Paused ? "unpause" : "pause")
new pausing[16]
format(pausing, 15, "%L", id, g_Paused ? "UNPAUSING" : "PAUSING")
console_print(id, "[AMXX] %L", id, pausing)
new activity = get_cvar_num("amx_show_activity")
if (activity != 0)
{
new players[32], pnum, msg[128], len
get_players(players, pnum, "c")
for (new i = 0; i < pnum; i++)
{
len = format(msg, 127, "%L", players, "ADMIN")
if (activity == 1)
len += copy(msg[len], 127-len, ":")
else
len += format(msg[len], 127-len, " %s: ", name)
format(msg[len], 127-len, "%L", players, g_Paused ? "UNPAUSE" : "PAUSE")
client_print(players, print_chat, "%s server", msg)
}
}
g_pauseCon = id
return PLUGIN_HANDLED
} |
|