AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   menu Items starts on Menu title (https://forums.alliedmods.net/showthread.php?t=242519)

proffs 06-20-2014 16:13

menu Items starts on Menu title
 
The first block is right after the title
I want it under like the others.

Pic: http://i.imgur.com/si5RJJ2.png


PHP Code:

ShowBlockSelectionMenu(id)
{
        new 
menu[256], title[32], entry[32], num;
       
        
format(titlecharsmax(title), "\r[%s] \yBlock Selection %d^n^n"PLUGIN_PREFIXg_block_selection_page[id]);
        
add(menucharsmax(menu), title);
       
        new 
start_block = ( g_block_selection_page[id] - ) * 8;
       
        for ( new 
start_blockstart_block 8; ++)
        {
                if ( 
TOTAL_BLOCKS )
                {
                        
num = ( start_block ) + 1;
                       
                        
format(entrycharsmax(entry), "\r%d. \w%s^n"numg_block_names[i]);
                }
                else
                {
                        
format(entrycharsmax(entry), "^n");
                }
               
                
add(menucharsmax(menu), entry);
        }
       
        if ( 
g_block_selection_page[id] < g_block_selection_pages_max )
        {
                
add(menucharsmax(menu), "^n\r9. \wMore");
        }
        else
        {
                
add(menucharsmax(menu), "^n");
        }
       
        
add(menucharsmax(menu), "^n\r0. \wBack");
       
        
show_menu(idg_keys_block_selection_menumenu, -1"BmBlockSelectionMenu");



SicknessArG 06-20-2014 17:01

Re: menu Items starts on Menu title
 
Try
Code:
    new title =  format(menu, charsmax(menu), "\r[%s] \yBlock Selection %d^n^n", PLUGIN_PREFIX, g_block_selection_page[id]);

Black Rose 06-20-2014 17:12

Re: menu Items starts on Menu title
 
Try increasing the buffer size for the title. 31 seems kind of small.

proffs 06-20-2014 17:26

Re: menu Items starts on Menu title
 
Quote:

Originally Posted by Black Rose (Post 2154801)
Try increasing the buffer size for the title. 31 seems kind of small.

Thanks increased to 64.
It works now!


All times are GMT -4. The time now is 21:09.

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