Raised This Month: $ Target: $400
 0% 

Stop set_task if menu doesn't exist.


Post New Thread Reply   
 
Thread Tools Display Modes
Unkolix
Veteran Member
Join Date: Sep 2012
Old 02-08-2013 , 12:47   Re: Stop set_task if menu doesn't exist.
Reply With Quote #11

Ok, nevermind. I will just remove the cancel menu then. :/
Unkolix is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 02-08-2013 , 13:47   Re: Stop set_task if menu doesn't exist.
Reply With Quote #12

Quote:
Originally Posted by Doc-Holiday View Post
And like I said you can't. The menu when closed due to an other menu doesn't call anything. Like I said check out that guys include. It correctly destroys the menu so if it destroys the menu them remove the task.

He explains exactly why what you want won't work without the include.

He's got a forward that's called when the menu is destroyed by another menu but not every menu uses this method yet so it still wouldn't work.

Maybe someone with better knowledge can figure something out but afaik there is no way
If another AMXX menu is shown on top of a new menu, the new menu's handler function is called with MENU_EXIT.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 02-08-2013 , 15:22   Re: Re: Stop set_task if menu doesn't exist.
Reply With Quote #13

Quote:
Originally Posted by Emp` View Post
If another AMXX menu is shown on top of a new menu, the new menu's handler function is called with MENU_EXIT.
According to the post in snippets section that's not called that's why it has a mem leak issue
Doc-Holiday is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 02-08-2013 , 15:54   Re: Stop set_task if menu doesn't exist.
Reply With Quote #14

Quote:
Originally Posted by Doc-Holiday View Post
According to the post in snippets section that's not called that's why it has a mem leak issue
Radio menus are not AMXX menus, which is what the leak issue is about.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 02-08-2013 , 16:14   Re: Re: Stop set_task if menu doesn't exist.
Reply With Quote #15

Quote:
Originally Posted by Emp` View Post
Radio menus are not AMXX menus, which is what the leak issue is about.
Thought it was just in general when menus are covered..

When menu is on screen and game commences menu goes away. That calls exit also?
Doc-Holiday is offline
Unkolix
Veteran Member
Join Date: Sep 2012
Old 02-09-2013 , 05:42   Re: Stop set_task if menu doesn't exist.
Reply With Quote #16

So it's possible to check if player closed the menu or another menu popped over that one?
Unkolix is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 02-09-2013 , 12:51   Re: Re: Stop set_task if menu doesn't exist.
Reply With Quote #17

Quote:
Originally Posted by Unkolix View Post
So it's possible to check if player closed the menu or another menu popped over that one?
Stick the remove task above your return for menu exit.

That will work when ever its covers by non amxx menu like the radios
Doc-Holiday is offline
Unkolix
Veteran Member
Join Date: Sep 2012
Old 02-09-2013 , 12:53   Re: Stop set_task if menu doesn't exist.
Reply With Quote #18

You mean?
PHP Code:
return PLUGIN_CONTINUE 
Unkolix is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 02-09-2013 , 15:02   Re: Re: Stop set_task if menu doesn't exist.
Reply With Quote #19

Here above the return
PHP Code:
if( item == MENU_EXIT )
{
menu_destroy(menu);
return 
PLUGIN_HANDLED;

Doc-Holiday 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 20:33.


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