|
if(end > g_menuplayersnum[id])
end = g_menuplayersnum[id]
static menubody[512]
new len = format(menubody, 511, "\y屏蔽麦克风菜单^n^n")
static name[32]
new b = 0, i
new keys = MENU_KEY_0
for(new a = start; a < end; ++a)
{
i = g_menuplayers[id][a]
get_user_name(i, name, 31)
if(i == id)
{
++b
len += format(menubody[len], 511 - len, "\d# %s %s\w^n", name, g_mute[id][i] ? "\r(静音)\w" : "")
}
else
{
keys |= (1<<b)
len += format(menubody[len], 511 - len, "%s%d. %s %s\w^n", g_mute[id][i] ? "\r" : "\w", ++b, name, g_mute[id][i] ? "\r(静音)\w" : "")
}
}
if(end != g_menuplayersnum[id])
{
format(menubody[len], 511 - len, "^n9. %s...^n0. %s", "More", pos ? "Back" : "Exit")
keys |= MENU_KEY_9
}
else
format(menubody[len], 511-len, "^n0. %s", pos ? "Back" : "Exit")
show_menu(id, keys, menubody, -1, "mute menu")
}
public action_mutemenu(id, key)
{
switch(key)
{
case 8: display_mutemenu(id, ++g_menuposition[id])
case 9: display_mutemenu(id, --g_menuposition[id])
default:
{
new player = g_menuplayers[id][g_menuposition[id] * 8 + key]
g_mute[id][player] = g_mute[id][player] ? false : true
display_mutemenu(id, g_menuposition[id])
static name[32]
get_user_name(player, name, 31)
client_print(id, print_chat, "[系统] 你已经将玩家 %s 的 MIC %s屏蔽 ", name,g_mute[id][player] ? "" : "解除")
}
}
|
|