Raised This Month: $12 Target: $400
 3% 

Adding a text under a menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Paradox.
Member
Join Date: May 2013
Old 12-12-2013 , 10:27   Adding a text under a menu
Reply With Quote #1

Hello. I tried to make a menu and to add a text just above the title,but it didn't worked. This is my code:

Code:
 #include <amxmodx>

 public plugin_init()
 {
    

    register_clcmd( "menu","menu" );
  
 }
 
 public menu( id )
 {
   
    new menu = menu_create( "\rMenu title:", "menu_handler" );
  

   
    menu_additem( menu, "\wOption 1", "", 0 );
    menu_additem( menu, "\wOption 2", "", 0 );
    menu_additem( menu, "\wOption 3", "", 0 );


   
    menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
   
    
    menu_display( id, menu, 0 );
  
 }
 
 public menu_handler( id, menu, item )
 {
    
    switch( item )
    {
        case 0:
        {
          
            //something
         }
        case 1:
        {
            //something
        }
        case 2:
        {
           something
        }
      
    }

    
    menu_destroy( menu );
    return PLUGIN_HANDLED;
 }
This should show something like this:
Code:
Menu Title:

Option 1
Option 2
Option 3
And I want to look like this
Code:
Menu title:
You have x money.

Option 1
Option 2
Option 3
How can I add a secondary text under the menu title.

P.S.: I tried with formatex but ..... Some ideeas?

Last edited by Paradox.; 12-12-2013 at 10:28.
Paradox. is offline
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 12-12-2013 , 12:00   Re: Adding a text under a menu
Reply With Quote #2

PHP Code:
new menu menu_create"\rMenu title: ^n\wBla Bla Bla""menu_handler" ); 
__________________
simanovich is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 12-12-2013 , 12:27   Re: Adding a text under a menu
Reply With Quote #3

You need to format your menu title if you want to show some variables.

Code:
new szMenuTitle[ 64 ], iNumber = 5; formatex( szMenuTitle, charsmax( szMenuTitle ), "\rMenu title: ^nMy number: %i", iNumber ) new menu = menu_create( szMenuTitle, "menu_handler" );
__________________

Accepting all kinds of requests via private message.
matsi is offline
Paradox.
Member
Join Date: May 2013
Old 12-12-2013 , 13:32   Re: Adding a text under a menu
Reply With Quote #4

Quote:
Originally Posted by matsi View Post
You need to format your menu title if you want to show some variables.

Code:
new szMenuTitle[ 64 ], iNumber = 5; formatex( szMenuTitle, charsmax( szMenuTitle ), "\rMenu title: ^nMy number: %i", iNumber ) new menu = menu_create( szMenuTitle, "menu_handler" );
You didn't understand,I want that the line to be showed under de menu title,not in it. Like this

Menu title it this
This is the second line under the menu.

Last edited by Paradox.; 12-12-2013 at 13:32.
Paradox. is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 12-12-2013 , 14:40   Re: Adding a text under a menu
Reply With Quote #5

If what simanovich says doesn't work then you have three options.

1. Use the old menu style
2. Create a menu item with MENU_BLOCKED callback handler
3. Use menu_addtext, but that only works if an item has been added previously
Backstabnoob is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 12-12-2013 , 19:13   Re: Adding a text under a menu
Reply With Quote #6

simanovich's thing will work.
mottzi is offline
Send a message via MSN to mottzi
Paradox.
Member
Join Date: May 2013
Old 12-13-2013 , 08:45   Re: Adding a text under a menu
Reply With Quote #7

Quote:
Originally Posted by mottzi View Post
simanovich's thing will work.
Why are you posting here ? Just for +1 ? If you don't understand what I want,then don't post stupid thins.

All I want is to format de menu to look like that:

Code:
This is the menu title!!!!!!!!!!!!!!!!!!!!!!!Try to understand that is the title
This line is under the title!!!!!!!!!!!!!!!Under!!!! it not the same as the menu.
Paradox. is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 12-13-2013 , 08:59   Re: Adding a text under a menu
Reply With Quote #8

Still true..

Quote:
Originally Posted by mottzi View Post
simanovich's thing will work.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.

Last edited by bibu; 12-13-2013 at 09:00.
bibu is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 12-13-2013 , 09:02   Re: Adding a text under a menu
Reply With Quote #9

Paradox., please read the thread again, and just try it out. I guess you ignore the '^n' in the menu titles we suggested.
mottzi is offline
Send a message via MSN to mottzi
Paradox.
Member
Join Date: May 2013
Old 12-13-2013 , 09:23   Re: Adding a text under a menu
Reply With Quote #10

Quote:
Originally Posted by mottzi View Post
Paradox., please read the thread again, and just try it out. I guess you ignore the '^n' in the menu titles we suggested.
But I need to use an integer in the second line... not just text. Like "msg %i",var

Last edited by Paradox.; 12-13-2013 at 09:23.
Paradox. 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 23:12.


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