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

Solved ML Menu's 1.9.0


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-15-2020 , 17:19   ML Menu's 1.9.0
Reply With Quote #1

I'm currently experiencing problems with creating ML menu's using 1.9.0.

This code should work, as i've done research after someone told me this would work

PHP Code:
iMainMenu menu_create("MAIN_MENU_HEADER""MainMenuHandler"true); 
Currently my menu is just displaying plain text as it is written in the code.

My console logs & amxx version can be checked in this post: https://forums.alliedmods.net/showpo...1&postcount=27

I was thinking maybe there's something wrong with my checks, but that'll be unlikely be the problem.


This is working, but the way i tried it above doesn't.

PHP Code:
public CheckSettings(id) {
    if(
get_user_flags(id) & ADMIN_KICK || !get_pcvar_num(pAdminsOnly)) {
        new 
iMainMenu;

        
#if AMXX_VERSION_NUM < 190
        
formatex(szTempcharsmax(szTemp), "%L"id"MAIN_MENU_HEADER");
        
iMainMenu menu_create(szTemp"MainMenuHandler");
        
#else
        
iMainMenu menu_create(fmt("%L"id"MAIN_MENU_HEADER"), "MainMenuHandler"1);
        
#endif

        
for(new isizeof(szMainMenuText); i++) {
            
#if AMXX_VERSION_NUM < 190
            
formatex(szTempcharsmax(szTemp), "%L",  idszMainMenuText[i]);
            
menu_additem(iMainMenuszTemp);
            
#else
            
menu_additem(iMainMenufmt("%L"idszMainMenuText[i]));
            
#endif
        
}
        
menu_display(idiMainMenu);
    }

__________________

Last edited by Napoleon_be; 04-24-2020 at 09:18.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 04-15-2020 , 18:36   Re: ML Menu's 1.9.0
Reply With Quote #2

Quote:
Originally Posted by Napoleon_be View Post
I'm currently experiencing problems with creating ML menu's using 1.9.0.

This code should work, as i've done research after someone told me this would work

PHP Code:
iMainMenu menu_create("MAIN_MENU_HEADER""MainMenuHandler"true); 
This is the correct using of the function 'menu_create'
PHP Code:
native menu_create(const title[], const handler[], ml=0); 
@param ml Unused (should be 0).

http://www.amxmodx.org/api/newmenus/menu_create

So, you should try this:
PHP Code:
new Temp[64]
formatex(Tempcharsmax(Temp), "%L""MAIN_MENU_HEADER")
new 
iMainMenu menu_create(Temp"MainMenuHandler"
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-15-2020 , 18:53   Re: ML Menu's 1.9.0
Reply With Quote #3

Quote:
Originally Posted by Shadows Adi View Post
This is the correct using of the function 'menu_create'
PHP Code:
native menu_create(const title[], const handler[], ml=0); 
@param ml Unused (should be 0).

http://www.amxmodx.org/api/newmenus/menu_create

So, you should try this:
PHP Code:
new Temp[64]
formatex(Tempcharsmax(Temp), "%L""MAIN_MENU_HEADER")
new 
iMainMenu menu_create(Temp"MainMenuHandler"
I appreciate your help, but your answer is not what i need.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-15-2020 , 18:55   Re: ML Menu's 1.9.0
Reply With Quote #4

@Shadows Adi - it's correct. The AMXX documentation here is outdated.

http://amxx-bg.info/api/newmenus/menu_create
https://github.com/alliedmodders/amxmodx/pull/593

I will check this tomorrow. Maybe there's something messed up with the Github commits. I haven't tested it.
__________________

Last edited by OciXCrom; 04-15-2020 at 19:04.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-15-2020 , 19:56   Re: ML Menu's 1.9.0
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
@Shadows Adi - it's correct. The AMXX documentation here is outdated.

http://amxx-bg.info/api/newmenus/menu_create
https://github.com/alliedmodders/amxmodx/pull/593

I will check this tomorrow. Maybe there's something messed up with the Github commits. I haven't tested it.
Thanks
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-16-2020 , 15:51   Re: ML Menu's 1.9.0
Reply With Quote #6

It turns out this was added in AMXX 1.10, not 1.9. Just tested and it works with the latest 1.10 build.

You're probably going to overcomplicate things if you add another check for 1.10. Either stick to what you have right now with the 1.9 check or make the plugin 1.10 only. It's your choice. You can do all 3 checks if you really want.
__________________

Last edited by OciXCrom; 04-16-2020 at 15:52.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-16-2020 , 16:00   Re: ML Menu's 1.9.0
Reply With Quote #7

Quote:
Originally Posted by OciXCrom View Post
It turns out this was added in AMXX 1.10, not 1.9. Just tested and it works with the latest 1.10 build.

You're probably going to overcomplicate things if you add another check for 1.10. Either stick to what you have right now with the 1.9 check or make the plugin 1.10 only. It's your choice. You can do all 3 checks if you really want.
Meh i'm not gonna make any changes then. The code is good enough as it is now, thanks for keeping me up to date .
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-24-2020 , 09:18   Re: ML Menu's 1.9.0
Reply With Quote #8

Solved, updated to 1.10.0 and it works now, so it appears this is only possible from 1.10.0.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 08:41.


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