Raised This Month: $ Target: $400
 0% 

Menu Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NucL3ra
Veteran Member
Join Date: Sep 2008
Location: Bucuresti , Romania
Old 11-07-2009 , 13:46   Menu Help
Reply With Quote #1

I have modified the kz_stats plugin so i made multiple tops for most of jumping techniques. But if i make over 6 tops i get the 7th one on "a second page".
I want to put all of them into one page like this:

Code:
Top 10 Menu :
1. Long jump top
2. Count jump top
3. Bhop Top
4. Stand up bhop top
5. Double count Jump top
6. Multi Count jump top
7. Weird Jump top
8. Ladder Drop bhop top
9. Ladder Jump top

0. Exit
But when i did it i have like this:
Code:
Top 10 Menu [1/2]:
1. Long jump top
2. Count jump top
3. Bhop Top
4. Stand up bhop top
5. Double count Jump top
6. Multi Count jump top
7. Weird Jump top

8. Next page
9. Back

0. Exit
And
Code:
Top 10 Menu [2/2]:

1. Ladder Drop Bhop Top
2. Ladder Jump top

8. Next page
9. Back

0.Exit
How can i fix it ?

The code is

PHP Code:
public view_menu(id) {    
    new 
menu menu_create("Top 10 Menu:""menu_handler");
    
menu_additem(menu"\w LongJump Top""1"0);
    
menu_additem(menu"\w CountJump Top""2"0);
    
menu_additem(menu"\w Bunny Hop Top""3"0);
    
menu_additem(menu"\w Stand-Up Bhop Top""4"0);
    
menu_additem(menu"\w Double CountJump Top""5"0);
    
menu_additem(menu"\w Multi CountJump Top""6"0);
    
menu_additem(menu"\w WeirdJump Top""7"0);
    
menu_additem(menu"\w Ladder Drop Bhop Top""8"0);
    
menu_additem(menu"\w LadderJump Top""9"0);

    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
    
menu_display(idmenu0);
    
    return 
1;
}

public 
menu_handler(idmenuitem) {
    if (
item == MENU_EXIT)
    {
        
menu_cancel(id);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], name[32];
    new 
accesscallback;
    
    
menu_item_getinfo(menuitemaccessdata5__callback);
    
    new 
key str_to_num(data);
    
get_user_name(idname31);
    
    switch (
key
    {
        case 
1
        {
            
ljten_show(id);
        }
        case 
2:
        {    
            
cjten_show(id);
        }
        case 
3:
        {
             
bjten_show(id);
        }
        case 
4:
        {
            
sbjten_show(id);            
        }
        case 
5:
        {    
            
dcjten_show(id);
        }
        case 
6:
        {
            
topten_show(id);
        }
        case 
7:
        {
            
wjten_show(id);
        }
        case 
8:
        {
            
lbjten_show(id);
        }
        case 
9:
        {    
            
lajten_show(id);
        }
        
        
    }
    
    
menu_cancel(id);
    return 
PLUGIN_HANDLED;


Last edited by NucL3ra; 11-07-2009 at 13:49.
NucL3ra is offline
Send a message via Yahoo to NucL3ra
unnyquee
Senior Member
Join Date: Jun 2009
Location: Constanta, Romania
Old 11-07-2009 , 13:56   Re: Menu Help
Reply With Quote #2

Add:
PHP Code:
menu_setprop(menuMPROP_PERPAGE9); 
__________________
unnyquee is offline
NucL3ra
Veteran Member
Join Date: Sep 2008
Location: Bucuresti , Romania
Old 11-07-2009 , 14:11   Re: Menu Help
Reply With Quote #3

I get this error

Tell me it can be fixed

Code:
L 11/07/2009 - 21:13:15: Cannot set 9 items per page
L 11/07/2009 - 21:13:15: [AMXX] Displaying debug trace (plugin "kz_stats.amxx")
L 11/07/2009 - 21:13:15: [AMXX] Run time error 10: native error (native "menu_setprop")
L 11/07/2009 - 21:13:15: [AMXX]    [0] kz_stats.sma::view_menu (line 4107)

Last edited by NucL3ra; 11-07-2009 at 14:15.
NucL3ra is offline
Send a message via Yahoo to NucL3ra
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-07-2009 , 14:29   Re: Menu Help
Reply With Quote #4

This only works if you have 9 or less items.
Code:
menu_setprop( hMenu, MPROP_PERPAGE, 0 ); // Note: You will have to add your own exit: menu_additem( hMenu, "Long jump top", "1", ); // ... // Notice ^n for new line between last item and exit menu_additem( hMenu, "Ladder Jump Top^n", "9" ); menu_additem( hMenu, "Exit", "*" ); public MenuHandler( iPlayer, hMenu, iItem ) {     if( iItem == MENU_EXIT ) {         goto exit_menu;     }         new iAccess, szInfo[ 3 ], hCallback;     menu_item_getinfo( hMenu, iItem, iAccess, szInfo, 2, _, _, hCallback );         if( szInfo[ 0 ] == '*' ) {         goto exit_menu;     }         // your menu code     // str_to_num( szInfo ) == key pressed         return;     exit_menu:     menu_destroy( hMenu ); }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
NucL3ra
Veteran Member
Join Date: Sep 2008
Location: Bucuresti , Romania
Old 11-07-2009 , 14:51   Re: Menu Help
Reply With Quote #5

So , it should look like this ?

PHP Code:
menu_setprophMenuMPROP_PERPAGE);

menu_additemhMenu"LongJump Top""1", );
menu_additemhMenu"CountJump top""2", );
menu_additemhMenu"Bhop Top""3", );
menu_additemhMenu"Stand-Up Bhop Top""4", );
menu_additemhMenu"WeirdJump Top""5",);
menu_additemhMenu"Double CountJump Top""6", );
menu_additemhMenu"Multi CountJup Top""7", );
menu_additemhMenu"Ladder Drop Bhop Top""8", );
menu_additemhMenu"LadderJump Top^n""9" );
menu_additemhMenu"Exit""*" );

public 
MenuHandleriPlayerhMenuiItem ) { 
    if( 
iItem == MENU_EXIT ) {
         goto 
exit_menu;
    } 

    new 
iAccessszInfo], hCallback;
    
menu_item_getinfohMenuiItemiAccessszInfo2__hCallback );


if( 
szInfo] == '*' ) {
     goto 
exit_menu;



    new 
key str_to_numsZinfo );
    
get_user_name(idname31);
    
    switch (
key
    {
        case 
1
        {
            
ljten_show(id);
        }
        case 
2:
        {    
            
cjten_show(id);
        }
        case 
3:
        {
             
bjten_show(id);
        }
        case 
4:
        {
            
sbjten_show(id);            
        }
        case 
5:
        {    
            
dcjten_show(id);
        }
        case 
6:
        {
            
topten_show(id);
        }
        case 
7:
        {
            
wjten_show(id);
        }
        case 
8:
        {
            
lbjten_show(id);
        }
        case 
9:
        {    
            
lajten_show(id);
        }
        
        
    }
    
    
menu_cancel(id);
    return 
PLUGIN_HANDLED;




exit_menu:
    
menu_destroyhMenu );


Last edited by NucL3ra; 11-07-2009 at 14:54.
NucL3ra is offline
Send a message via Yahoo to NucL3ra
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-07-2009 , 15:10   Re: Menu Help
Reply With Quote #6

Wow.
Don't just copy+paste.
Understand the code.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
NucL3ra
Veteran Member
Join Date: Sep 2008
Location: Bucuresti , Romania
Old 11-07-2009 , 15:12   Re: Menu Help
Reply With Quote #7

Right , i knew you'll answer like that.
Probably I'm hard understander , i'll try again now.

Last edited by NucL3ra; 11-07-2009 at 15:27.
NucL3ra is offline
Send a message via Yahoo to NucL3ra
NucL3ra
Veteran Member
Join Date: Sep 2008
Location: Bucuresti , Romania
Old 11-07-2009 , 15:27   Re: Menu Help
Reply With Quote #8

It doesn't work like this either:

PHP Code:
public view_menu(id) {    
new 
hMenu menu_create("Top 10 Menu:""hMenu_handler");
menu_setprophMenuMPROP_PERPAGE0, );

menu_additemhMenu"LongJump Top""1", );
menu_additemhMenu"CountJump top""2", );
menu_additemhMenu"Bhop Top""3", );
menu_additemhMenu"Stand-Up Bhop Top""4", );
menu_additemhMenu"WeirdJump Top""5",);
menu_additemhMenu"Double CountJump Top""6", );
menu_additemhMenu"Multi CountJup Top""7", );
menu_additemhMenu"Ladder Drop Bhop Top""8", );
menu_additemhMenu"LadderJump Top^n""9", );
menu_additemhMenu"Exit""*", );

public 
MenuHandleriPlayerhMenuiItem ) {
    if( 
iItem == MENU_EXIT ) {
         goto 
exit_menu;
    }

    new 
iAccessszInfo], hCallback;
    
menu_item_getinfohMenuiItemiAccessszInfo2__hCallback );


if ( 
szInfo] == '*' ) goto exit_menu;
if ( 
sZinfo ] == '1') goto ljten_show(id);
if ( 
sZinfo ] == '2') goto cjten_show(id);
if ( 
sZinfo ] == '3') goto bjten_show(id);
if ( 
sZinfo ] == '4') goto sbjten_show(id);    
if ( 
sZinfo ] == '5') goto dcjten_show(id);
if ( 
sZinfo ] == '6') goto mcjten_show(id);
if ( 
sZinfo ] == '7') goto wjten_show(id);
if ( 
sZinfo ] == '8') goto lbjen_show(id);
if ( 
sZinfo ] == '9') goto lajten_show(id);
        
        
    }

exit_menu:
    
menu_destroyhMenu );

NucL3ra is offline
Send a message via Yahoo to NucL3ra
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 11-07-2009 , 15:55   Re: Menu Help
Reply With Quote #9

Oh wow.
PHP Code:
public MenuHandleridiMenuiItem ) {
    if( 
iItem == MENU_EXIT ) {
        
menu_destroyiMenu );
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
szInfo], _Hi;
    
menu_item_getinfohMenuiItem_HiszInfo1___Hi );
    
    switch( 
szInfo] ) {
        case 
'1'ljten_showid );
        case 
'2'cjten_showid );
        
// [ ... ]
        
case '*': { /* do nothing */ }
    }
    
    
menu_destroyiMenu );
    
    return 
PLUGIN_HANDLED;

__________________
xPaw is offline
NucL3ra
Veteran Member
Join Date: Sep 2008
Location: Bucuresti , Romania
Old 11-07-2009 , 15:55   Re: Menu Help
Reply With Quote #10

+1 fail.
PHP Code:
public view_menu(id) {    
new 
hMenu menu_create("Top 10 Menu:""hMenu_handler");
menu_setprophMenuMPROP_PERPAGE);

menu_additemhMenu"LongJump Top""1", );
menu_additemhMenu"CountJump top""2", );
menu_additemhMenu"Bhop Top""3", );
menu_additemhMenu"Stand-Up Bhop Top""4", );
menu_additemhMenu"WeirdJump Top""5",);
menu_additemhMenu"Double CountJump Top""6", );
menu_additemhMenu"Multi CountJup Top""7", );
menu_additemhMenu"Ladder Drop Bhop Top""8", );
menu_additemhMenu"LadderJump Top^n""9", );
menu_additemhMenu"Exit""*", );

public 
MenuHandleriPlayerhMenuiItem ) {
    if( 
iItem == MENU_EXIT ) {
         goto 
exit_menu;
    }

    new 
iAccessszInfo], hCallback;
    
menu_item_getinfohMenuiItemiAccessszInfo2__hCallback );


if ( 
szInfo] == '*' ) goto exit_mnenu;
if ( 
szInfo] == '1' ) goto ljten_show(id);
if ( 
szInfo] == '2' ) goto cjten_show(id);
if ( 
szInfo] == '3' ) goto bjten_show(id);
if ( 
szInfo] == '4' ) goto sbjten_show(id);
if ( 
szInfo] == '5' ) goto dcjten_show(id);
if ( 
szInfo] == '6' ) goto topten_show(id);
if ( 
szInfo] == '7' ) goto wjten_show(id);
if ( 
szInfo] == '8' ) goto lbjten_show(id);
if ( 
szInfo] == '9' ) goto lajten_show(id);
      
        return;
       

exit_menu:
    
menu_destroyhMenu );

NucL3ra is offline
Send a message via Yahoo to NucL3ra
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 17:32.


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