Raised This Month: $ Target: $400
 0% 

damn menu - not working


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
crazy.cipry
Member
Join Date: Dec 2008
Location: Romania
Old 12-04-2010 , 17:56   damn menu - not working
Reply With Quote #1

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "Ciprian"

new g_Menug_Menu2;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd "say /menu""cmdMenu" );
    
register_clcmd "say_team /menu""cmdMenu" );
    
    
CreateMenus ( );
}

public 
plugin_precache ( ) {
    for ( new 
04++ ) {
        new 
s_Song64 ];
        
formatex s_Songcharsmax s_Song ), "misc/music%d.mp3");
        
        
precache_sounds_Song );
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
cmdMenu id menu_display idg_Menu);

CreateMenus ( ) {
    
g_Menu menu_create "\yPlayer Menu:""menu_handler" );
    
    
menu_additem g_Menu"\wMusic""\r1");
    
menu_additem g_Menu"\wSubMenu2""\r2");
    
    
menu_setprop g_MenuMPROP_EXITMEXIT_ALL );
    
    
g_Menu2 menu_create "\yMusic""sub_menu1_handler" );
    
    
menu_additem g_Menu2"\wSong 1""/r1");
    
menu_additem g_Menu2"\wSong 2""/r2");
    
menu_additem g_Menu2"\wSong 3""/r3");
    
menu_additem g_Menu2"\wSong 4""/r4");
    
    
menu_setprop g_Menu2MPROP_EXITMEXIT_ALL );
}

public 
menu_handler idmenuitem ) {
    if ( 
item == MENU_EXIT )
        return 
PLUGIN_HANDLED;
    
    new 
data], iName64 ];
    new 
accescallback;
    
menu_item_getinfo menuitemaccesdata5iName63callback );
    
    new 
key str_to_num data );
    
    switch ( 
key ) {
        case 
1: { menu_display idg_Menu2); }
        case 
2: { client_print idprint_chat"Try Again !"); }
    }
    
    return 
PLUGIN_HANDLED;
}

public 
sub_menu1_handler idmenuitem ) {
    if ( 
item == MENU_EXIT ) {
        if ( 
is_user_connected id ) )
            
menu_display idg_Menu);
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
data], iName64 ];
    new 
accescallback;
    
menu_item_getinfo menuitemaccesdata5iName63callback );
    
    new 
key str_to_num data );
    
    switch ( 
key ) {
        case 
1: { client_cmd id"stopsound; mp3 play sound/christmas/music1.mp3" ); }
        case 
2: { client_cmd id"stopsound; mp3 play sound/christmas/music2.mp3" ); }
        case 
3: { client_cmd id"stopsound; mp3 play sound/christmas/music3.mp3" ); }
        case 
4: { client_cmd id"stopsound; mp3 play sound/christmas/music4.mp3" ); }
    }
    
    return 
PLUGIN_HANDLED;

It shows the options:
1. Music
2. SubMenu2


0. Exit
but whatever button I press it exits the menu. If I type /menu again, the menu appears again but it does nothing.
What's the problem?
crazy.cipry is offline
 


Thread Tools
Display Modes

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 11:14.


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