AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Fix for AMXX custom menus (from ZP) (https://forums.alliedmods.net/showthread.php?t=332906)

kww 06-07-2021 14:38

Fix for AMXX custom menus (from ZP)
 
hi guys. What does this snippet do? Found it in ZP extra items menu. What does mean "fix"?
PHP Code:

// Fix for AMXX custom menus
if (pev_valid(id) == PDATA_SAFE)
    
set_pdata_int(idOFFSET_CSMENUCODE0


CrazY. 06-07-2021 19:02

Re: Fix for AMXX custom menus (from ZP)
 
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);
                }
        }


kww 06-07-2021 23:55

Re: Fix for AMXX custom menus (from ZP)
 
oh ok. Thanks for answer


All times are GMT -4. The time now is 02:31.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.