AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Back page? (https://forums.alliedmods.net/showthread.php?t=183780)

Bilal Pro 04-26-2012 14:52

Back page?
 
Hello there,

How do i create a backpage, i tryed this:
PHP Code:

menu_setprop(menuMPROP_BACKNAMEMENU_BACK

but it does not show the back button.

claudiuhks 04-26-2012 14:56

Re: Back page?
 
If you create a menu with more than six items, it will be automatically equipped with Back, Next and Exit items.

Bilal Pro 04-26-2012 15:00

Re: Back page?
 
Yeah but i dont have that :P in this menu im redirecting to another menu and when im inside that menu i want an option to go back to the main menu if you understand.

<VeCo> 04-26-2012 15:12

Re: Back page?
 
Then add manually an option "Back" that redirects.

Bilal Pro 04-26-2012 15:40

Re: Back page?
 
Quote:

Originally Posted by <VeCo> (Post 1696942)
Then add manually an option "Back" that redirects.

That's just an awfull answer :S

EpicMonkey 04-26-2012 17:03

Re: Back page?
 
Quote:

Originally Posted by Bilal Pro (Post 1696963)
That's just an awfull answer :S

its not an awful answer , its an answer to your answer

Devil259 04-26-2012 20:31

Re: Back page?
 
If you are using new menu system and there is >= 6 items, it creates them automaticaly for you.

If you use old menu system, you've to create it manually.

K.K.Lv 04-26-2012 22:48

Re: Back page?
 
Code:
  #define STR_BACK "Back" #define STR_NEXT "Next" #define STR_EXIT "Next"   //create_menu and return the menu index here //add menu item here.   menu_setprop(menu, MPROP_EXITNAME, STR_EXIT) if (menu_pages(menu) > 1)//if the item sum more than 6; {     menu_setprop(menu, MPROP_BACKNAME, STR_BACK);     menu_setprop(menu, MPROP_NEXTNAME, STR_NEXT); }

claudiuhks 04-27-2012 01:11

Re: Back page?
 
Quote:

Originally Posted by K.K.Lv (Post 1697151)
Code:
  #define STR_BACK "Back" #define STR_NEXT "Next" #define STR_EXIT "Next"   //create_menu and return the menu index here //add menu item here.   menu_setprop(menu, MPROP_EXITNAME, STR_EXIT) if (menu_pages(menu) > 1)//if the item sum more than 6; {     menu_setprop(menu, MPROP_BACKNAME, STR_BACK);     menu_setprop(menu, MPROP_NEXTNAME, STR_NEXT); }

That's only for multilingual... If your plugin has multilingual support, you are supposed to change the item's name. If menu has many than six items, it will be automatically equipped with Back, Next and Exit items, like Devil259 said.

fysiks 04-27-2012 04:04

Re: Back page?
 
Quote:

Originally Posted by Bilal Pro (Post 1696963)
That's just an awfull answer :S

That is the correct answer. There are no built-in functions for menus to interact with each other.

If you don't want them to be able to exit the sub menu and only go back then you can show the previous menu in the exit case of the sub menu.


All times are GMT -4. The time now is 07:50.

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