Raised This Month: $ Target: $400
 0% 

newmenus problem.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
luxor
Member
Join Date: Jan 2014
Old 08-20-2015 , 09:09   Re: newmenus problem.
Reply With Quote #5

Quote:
Originally Posted by Nextra View Post
You forgot to post the code to your "Answers_SubMenu" handler, but here's a rough outline of what would solve your problem:
it is useless, not here is the problem...

Quote:
Originally Posted by Nextra View Post
PHP Code:
public RaceMenu_Handler(idmenuitem) {
// ...
   
new menu menu_create(Text"Answers_SubMenu");
   
challenge_menu[id] = menu// save the menu id
// ...
}

public 
Answers_SubMenu(idmenuitem) {
// ...
   
challenge_menu[id] = -1// reset the menu id to an invalid id
// ...
}

public 
Refuse(id) {
   if (
challenge_menu[id] != -1)
      
menu_destroy(challenge_menu[id]); // only destroy if the menu still exists

Depending on how your current "Answers_SubMenu" looks your code would break even if the player presses exit manually. The code above is how you should usually solve this.
Answers_SubMenu won't be called, because another menu will display and will close my menu..

All the things will happen in this way :
1. menu created and desplayed from RaceMenu_Handler - my plugin
2. menu will be closed/distroyed and Answers_SubMenu won't be called - another plugin (which i deleted the source )
3. refuse will be called and a error will be appear - my plugin


so.. if is not an issue, and a new native menu_exists can't be created... how cand i know if my menu is destroyed or not ? tell me...
luxor is offline
 



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 18:42.


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