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

Open a new menu on menu_destory


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 05-22-2017 , 09:17   Open a new menu on menu_destory
Reply With Quote #1

I have a little dumb question probably
If I want when exitin from one menu to open another menu, so which one is best way:
- open the new menu after menu_destory for current menu
or
- open the new after menu_destory for current menu
???

And some code:
Code:
if(item == MENU_EXIT)     {         client_cmd(id, "menu_key_game_menu"); // This call a console command that open another menu (in another plugin);         menu_destroy(menu);         return PLUGIN_HANDLED;     }
Code:
if(item == MENU_EXIT)     {         menu_destroy(menu);         client_cmd(id, "menu_key_game_menu");         return PLUGIN_HANDLED;     }

Last edited by KiLLeR.; 05-22-2017 at 09:21.
KiLLeR. is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 05-22-2017 , 09:24   Re: Open a new menu on menu_destory
Reply With Quote #2

It's the same, both will still get executed at all.
__________________
edon1337 is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 05-22-2017 , 11:33   Re: Open a new menu on menu_destory
Reply With Quote #3

edon is right, you should not have any problem, the principa is to do that before return PLUGIN_HANDLED so should work on both methods.
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-22-2017 , 14:07   Re: Open a new menu on menu_destory
Reply With Quote #4

Client_cmd will get executed after menu_destroy in both cases because there's a delay. I would destroy the current menu before displaying a new one - seems the most logical way to do it.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 05-23-2017 , 03:54   Re: Open a new menu on menu_destory
Reply With Quote #5

engclient_cmd ftw.
__________________
HamletEagle 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 10:28.


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