Can anyone help me with making and how the player showing menu's work. Like the kick menu amxx comes with. Just the ones that show all the names of players in your server at the time. I have already looked at the code for them, but i don't understand the multilingual parts and some other things.
For all you people that don't want to find it, here is just the kick menu
Code:
/* Kick */
public actionKickMenu(id,key)
{
switch (key) {
case 8: displayKickMenu(id,++g_menuPosition[id])
case 9: displayKickMenu(id,--g_menuPosition[id])
default: {
new player = g_menuPlayers[id][g_menuPosition[id] * 8 + key]
new authid[32],authid2[32], name[32], name2[32]
get_user_authid(id,authid,31)
get_user_authid(player,authid2,31)
get_user_name(id,name,31)
get_user_name(player,name2,31)
new userid2 = get_user_userid(player)
log_amx("Kick: ^"%s<%d><%s><>^" kick ^"%s<%d><%s><>^"",
name,get_user_userid(id),authid, name2,userid2,authid2 )
switch (get_cvar_num("amx_show_activity")) {
case 2: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_KICK_2",name,name2)
case 1: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_KICK_1",name2)
}
server_cmd("kick #%d",userid2)
server_exec()
displayKickMenu(id,g_menuPosition[id])
}
}
return PLUGIN_HANDLED
}
displayKickMenu(id,pos) {
if (pos < 0) return
get_players(g_menuPlayers[id],g_menuPlayersNum[id])
new menuBody[512]
new b = 0
new i
new name[32]
new start = pos * 8
if (start >= g_menuPlayersNum[id])
start = pos = g_menuPosition[id] = 0
new len = format(menuBody,511, g_coloredMenus ?
"\y%L\R%d/%d^n\w^n" : "%L %d/%d^n^n",
id,"KICK_MENU",pos+1,( g_menuPlayersNum[id] / 8 + ((g_menuPlayersNum[id] % 8) ? 1 : 0 )) )
new end = start + 8
new keys = MENU_KEY_0
if (end > g_menuPlayersNum[id])
end = g_menuPlayersNum[id]
for (new a = start; a < end; ++a) {
i = g_menuPlayers[id][a]
get_user_name(i,name,31)
if ( access(i,ADMIN_IMMUNITY) ) {
++b
if ( g_coloredMenus )
len += format(menuBody[len],511-len,"\d%d. %s^n\w",b,name)
else
len += format(menuBody[len],511-len,"#. %s^n",name)
}
else {
keys |= (1<<b)
len += format(menuBody[len],511-len,"%d. %s^n",++b,name)
}
}
if (end != g_menuPlayersNum[id]) {
format(menuBody[len],511-len,"^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")
keys |= MENU_KEY_9
}
else format(menuBody[len],511-len,"^n0. %L", id, pos ? "BACK" : "EXIT")
show_menu(id,keys,menuBody,-1,"Kick Menu")
}
public cmdKickMenu(id,level,cid) {
if (cmd_access(id,level,cid,1))
displayKickMenu(id,g_menuPosition[id] = 0)
return PLUGIN_HANDLED
}