This is to make sure you are not viewing another menu from the game itself, which would cause a problem.
You don't need that in the latest versions of amx mod x.
menu_display:
https://github.com/alliedmodders/amx...menus.cpp#L914
show_menu:
https://github.com/alliedmodders/amx...modx.cpp#L1345
Code:
if (g_bmod_cstrike)
{
enum JoinState { Joined = 0 };
enum MenuState { Menu_OFF = 0, Menu_ChooseTeam = 1, Menu_ChooseAppearance = 3 };
GET_OFFSET("CBasePlayer", m_iJoiningState);
GET_OFFSET("CBasePlayer", m_iMenu);
if (get_pdata<int>(pPlayer->pEdict, m_iJoiningState) == Joined || (get_pdata<int>(pPlayer->pEdict, m_iMenu) != Menu_ChooseTeam && get_pdata<int>(pPlayer->pEdict, m_iMenu) != Menu_ChooseAppearance))
{
set_pdata<int>(pPlayer->pEdict, m_iMenu, Menu_OFF);
}
}
__________________