|
发表于 2005-6-11 07:58:07
|
显示全部楼层
|阅读模式
来自 中国–广东–深圳–南山区
请教一个问题,下面是我修改的一段代码,就是amx_redirect.sma的,在下面判断时候有OP通道权限的时候,不管我用没用OP通道权限的ID,都执行到显示B######那行,为什么这样呢???而adminslots.sma却可以。。
public client_connect(id)
{
new maxplayers
new reserved
new slotsfree
if(numServers > 0)
{
new randomServer
if(numServers > 1)
randomServer = random_num(0,numServers-1)
else
randomServer = 0
if(cvar_exists("amx_reservation"))
reserved = get_cvar_num("amx_reservation")
else
reserved = 0
maxplayers = get_maxplayers()
new players = get_playersnum() + 1
slotsfree = maxplayers - reserved - players
client_cmd(id,"echo ^"A###########^"") /*test*/
if(!( access(id,ADMIN_RESERVATION) ))
{
client_cmd(id,"echo ^"B###########^"") /*test*/
if( slotsfree <= 0 )
{
client_cmd(id,"echo ^"C###########^"") /*test*/
redirect_client(id,randomServer)
return PLUGIN_HANDLED
}
}
}
return PLUGIN_CONTINUE
} |
|