diff --git a/amxmodx/CMisc.cpp b/amxmodx/CMisc.cpp index 566cccc5..3d304cc2 100755 --- a/amxmodx/CMisc.cpp +++ b/amxmodx/CMisc.cpp @@ -90,6 +90,7 @@ bool CPlayer::Connect(const char* connectname, const char* ipaddress) time = gpGlobals->time; bot = IsBot(); death_killer = 0; + menu = 0; memset(flags, 0, sizeof(flags)); memset(weapons, 0, sizeof(weapons)); diff --git a/amxmodx/CMisc.h b/amxmodx/CMisc.h index 3d58eb32..313d97bf 100755 --- a/amxmodx/CMisc.h +++ b/amxmodx/CMisc.h @@ -86,7 +86,8 @@ public: bool ingame; bool bot; bool authorized; - + bool vgui; + float time; float playtime; float menuexpire; diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index 3bc8f40b..20d2de6f 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -925,6 +925,7 @@ static cell AMX_NATIVE_CALL show_menu(AMX *amx, cell *params) /* 3 param */ { pPlayer->keys = keys; pPlayer->menu = menuid; + pPlayer->vgui = false; if (time == -1) pPlayer->menuexpire = INFINITE; @@ -951,7 +952,8 @@ static cell AMX_NATIVE_CALL show_menu(AMX *amx, cell *params) /* 3 param */ { pPlayer->keys = keys; pPlayer->menu = menuid; - + pPlayer->vgui = false; + if (time == -1) pPlayer->menuexpire = INFINITE; else diff --git a/amxmodx/emsg.cpp b/amxmodx/emsg.cpp index 7f487f6c..d20ecd67 100755 --- a/amxmodx/emsg.cpp +++ b/amxmodx/emsg.cpp @@ -59,6 +59,8 @@ void Client_VGUIMenu(void* mValue) { if (!mPlayer) return; + mPlayer->vgui = true; + switch (mState++) { case 0: @@ -72,7 +74,9 @@ void Client_VGUIMenu(void* mValue) void Client_ShowMenu(void* mValue) { if (!mPlayer) return; - + + mPlayer->vgui = true; + switch (mState++) { case 0: diff --git a/amxmodx/meta_api.cpp b/amxmodx/meta_api.cpp index e57de26f..e8de75f8 100755 --- a/amxmodx/meta_api.cpp +++ b/amxmodx/meta_api.cpp @@ -716,7 +716,7 @@ void C_ClientCommand(edict_t *pEntity) if (pPlayer->keys & bit_key) { - if ((pPlayer->menu > 0) && (gpGlobals->time > pPlayer->menuexpire)) + if ((pPlayer->menu > 0 && !pPlayer->vgui) && (gpGlobals->time > pPlayer->menuexpire)) { pPlayer->menu = 0; pPlayer->keys = 0;