Raised This Month: $51 Target: $400
 12% 

Solved Fix for AMXX custom menus (from ZP)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 06-07-2021 , 14:38   Fix for AMXX custom menus (from ZP)
Reply With Quote #1

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

Last edited by kww; 06-07-2021 at 23:56.
kww is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 06-07-2021 , 19:02   Re: Fix for AMXX custom menus (from ZP)
Reply With Quote #2

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);
		}
	}
__________________









Last edited by CrazY.; 06-07-2021 at 19:04.
CrazY. is offline
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 06-07-2021 , 23:55   Re: Fix for AMXX custom menus (from ZP)
Reply With Quote #3

oh ok. Thanks for answer
kww is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:32.


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