AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Change button number in menu. (https://forums.alliedmods.net/showthread.php?t=294414)

Vliket 02-26-2017 10:13

Change button number in menu.
 
Hello, i have problem on my server, i have Vip menu but when i want to Exit menu that button is on number 9 but i wants to have it on 0 can someone help me how to fix it in this .sma file?
Thanks

Download .sma : http://leteckaposta.cz/599771114

OciXCrom 02-26-2017 10:46

Re: Change button number in menu.
 
Remove the blank slots.

Bugsy 02-26-2017 11:11

Re: Change button number in menu.
 
Quote:

Originally Posted by OciXCrom (Post 2498766)
Remove the blank slots.

But then he loses the menu appearance with the blanks which I imagine was done so intentionally.

You can fix this by adding an additional blank with the second param set to 1. This function was missing closing brackets so I added these to make it compile. See the highlighted line that was added.
Code:
public cmd_menu(id) {     if(get_pcvar_num(onoffmenu))     {         if(is_user_alive(id))         {             static item[64]                         new menu = menu_create("\yVIP MENU \d(/vipmenu) ^n\dVyber si zbran zadarmo", "menu_handler")                         menu_additem(menu, "M4A1 + Deagle \y[VIP]", "1", 0)             menu_additem(menu, "AK47 + Deagle \y[VIP]", "2", 0)               menu_additem(menu, "AWP + Deagle \y[VIP]", "3", 0)               menu_addblank(menu, 0)               menu_additem(menu, "\yVIP Nastavenia", "4", 0)               menu_additem(menu, "\yZobrazit vyhody", "5", 0)                 menu_addblank(menu, 0)                       if ( Menu[ id ] )             {                 menu_additem(menu, "Zobrazovanie menu na zaciatku kola [\yZAPNUTE\w]", "6", 0)             }             else             {                 menu_additem(menu, "Zobrazovanie menu na zaciatku kola [\rVYPNUTE\w]", "6", 0)             }             menu_addblank(menu, 1)               menu_setprop(menu, MPROP_EXITNAME, "Zavriet")             menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)             menu_setprop(menu, MPROP_NUMBER_COLOR, "\r" )                         menu_display(id, menu, 0)         }     } }

JusTGo 02-26-2017 11:29

Re: Change button number in menu.
 
why not ^n ?

edon1337 02-26-2017 11:39

Re: Change button number in menu.
 
Quote:

Originally Posted by JusTGo (Post 2498776)
why not ^n ?

No.


All times are GMT -4. The time now is 20:49.

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