Raised This Month: $ Target: $400
 0% 

Menu Debug.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 09-19-2009 , 08:31   Menu Debug.
Reply With Quote #1

How to fix this error without using ;

Code:
L 09/19/2009 - 20:29:45: Invalid menu id 0(1)
L 09/19/2009 - 20:29:45: [AMXX] Run time error 10 (plugin "Music-Player.amxx") (native "menu_destroy") - debug not enabled!
L 09/19/2009 - 20:29:45: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes
PHP Code:
#include <amxmodx>  
 
public plugin_init( )  

        
register_plugin"Music Player""1.0""Mr.Noobie" )
        
register_clcmd"say /music""Menu" 
}
 
public 
Menuid )
{
        new 
menu menu_create"Music Menu""menu_handler" )
        
menu_additemmenu"28 Week Later""1")
        
menu_additemmenu"Stop Music""2")
        
menu_setpropmenuMPROP_EXITMEXIT_ALL )
        
menu_displayidmenu)
}
 
public 
menu_handleridmenuitem )
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroymenu )
        return 
PLUGIN_HANDLED
    
}
    new 
data], iName64 ]
    new 
accesscallback
    menu_item_getinfo
menuitemaccessdata5iName63callback )
    new 
key str_to_numdata )
    switch( 
key )
    {
        case 
1:
        {
            
chat_printid"You have selected 28 Week Later." )
            
menu_destroymenu )
        }
        case 
2:
        {
            
chat_printid"You have stop the music." )
            
menu_destroymenu )
        }
    }
    
menu_destroymenu )
    return 
PLUGIN_HANDLED


Last edited by Mr.Noobie; 09-19-2009 at 22:36.
Mr.Noobie is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 09-19-2009 , 08:38   Re: Menu Debug.
Reply With Quote #2

PHP Code:
        case 1:
        {
            
chat_printid"You have selected 28 Week Later." )
            
menu_destroymenu )
        }
        case 
2:
        {
            
chat_printid"You have stop the music." )
            
menu_destroymenu )
        } 
Don't destroy menu in case in this way, it's not needed
__________________
xbatista is offline
Send a message via Skype™ to xbatista
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 09-19-2009 , 08:52   Re: Menu Debug.
Reply With Quote #3

Quote:
Originally Posted by xbatista View Post
PHP Code:
        case 1:
        {
            
chat_printid"You have selected 28 Week Later." )
            
menu_destroymenu )
        }
        case 
2:
        {
            
chat_printid"You have stop the music." )
            
menu_destroymenu )
        } 
Don't destroy menu in case in this way, it's not needed
I don't understand.

Just remove the menu_destroy ?
Mr.Noobie is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 09-19-2009 , 10:14   Re: Menu Debug.
Reply With Quote #4

yes
__________________
xPaw is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-19-2009 , 13:44   Re: Menu Debug.
Reply With Quote #5

The reason: You are trying to destroy a menu that was already destroyed in the switch statement. YOu can't destroy a menu that does not exist.
__________________
fysiks is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 09-19-2009 , 22:34   Re: Menu Debug.
Reply With Quote #6

Thanks for the help
Mr.Noobie 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 08:18.


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