Code:
// Game Menu
show_menu_game(id)
{
// Player disconnected?
if (!g_isconnected[id])
return;
static menu[250], len, userflags
len = 0
userflags = get_user_flags(id)
// Title
if(userflags & ADMIN_SLAY)
len += formatex(menu[len], charsmax(menu) - len, "%L^n^n", id, "MENU_MAIN_NAME")
else if(userflags & ADMIN_LEVEL_D)
len += formatex(menu[len], charsmax(menu) - len, "%L^n^n", id, "MENU_MAIN_NAME")
else if(userflags & ADMIN_LEVEL_E)
len += formatex(menu[len], charsmax(menu) - len, "%L^n^n", id, "MENU_MAIN_NAME")
else if(userflags & ADMIN_LEVEL_A)
len += formatex(menu[len], charsmax(menu) - len, "%L^n^n", id, "MENU_MAIN_NAME")
else
len += formatex(menu[len], charsmax(menu) - len, "%L^n^n", id, "MENU_MAIN_NAME")
// 1. Buy weapons
if (get_pcvar_num(cvar_buycustom))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y1\r] \w %L^n", id, "MENU_BUY")
else
len += formatex(menu[len], charsmax(menu) - len, "\r[\y1\r] %L^n", id, "MENU_BUY")
// 2. RTV
len += formatex(menu[len], charsmax(menu) - len, "\r[\y2\r] \w %L^n", id, "ROCK_THE_MAP")
// 3. ResetScore
len += formatex(menu[len], charsmax(menu) - len, "\r[\y3\r] \w %L^n", id, "RESET_SCORE")
// 4. Unstuck
if (g_isalive[id])
len += formatex(menu[len], charsmax(menu) - len, "\r[\y4\r] \w %L^n", id, "MENU_UNSTUCK")
else
len += formatex(menu[len], charsmax(menu) - len, "\r[\y4\r] %L^n", id, "MENU_UNSTUCK")
// 5. Join spec
if (!g_isalive[id] || !get_pcvar_num(cvar_blocksuicide) || (userflags & g_access_flag[ACCESS_ADMIN_MENU]))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y5\r] \w %L^n^n", id, "MENU_SPECTATOR")
else
len += formatex(menu[len], charsmax(menu) - len, "\r[\y5\r] %L^n^n", id, "MENU_SPECTATOR")
// 6. Admin menu
if (userflags & g_access_flag[ACCESS_ADMIN_MENU])
len += formatex(menu[len], charsmax(menu) - len, "\r[\y6\r] \w %L", id, "MENU_ADMIN")
else
len += formatex(menu[len], charsmax(menu) - len, "\r[\y6\r] %L", id, "MENU_ADMIN")
// 0. Exit
len += formatex(menu[len], charsmax(menu) - len, "^n^n\r[\y0\r] \w %L", id, "MENU_EXIT")
// Fix for AMXX custom menus
if (pev_valid(id) == PDATA_SAFE)
set_pdata_int(id, OFFSET_CSMENUCODE, 0, OFFSET_LINUX)
show_menu(id, KEYSMENU, menu, -1, "Game Menu")
}