AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to make a back and next option on a menu (https://forums.alliedmods.net/showthread.php?t=117952)

Kreation 02-06-2010 13:17

How to make a back and next option on a menu
 
How would I make a back and next option if i run out of room on the first page of the menu? Would it be its own case like..

PHP Code:

case 9:
{
     
CmdNextMenuid )


or

PHP Code:

case 9:
{
     
CmdBackMenuid )


or are there certain props to use?
Thanks to anyone who helps.

Mxnn 02-06-2010 13:39

Re: How to make a back and next option on a menu
 
PHP Code:

Kick Player

$players
(1,8, %n. %v//Players will shown in buttons 1,2,3,4,5,6,7 and 8.
//%n represents the key pressed, and %v the player

$next(9,9Next//Button 9 will contain the "Next"

$exitorback(0,0. Exit,0. Back//Button 0 will contain exit or back. 

This i took from Menu Creator (amxx studio)

wrecked_ 02-06-2010 13:59

Re: How to make a back and next option on a menu
 
Quote:

Originally Posted by Kreation (Post 1080489)
How would I make a back and next option if i run out of room on the first page of the menu? Would it be its own case like..

PHP Code:

case 9:
{
     
CmdNextMenuid )


or

PHP Code:

case 9:
{
     
CmdBackMenuid )


or are there certain props to use?
Thanks to anyone who helps.

Make a sub-menu and name it next. Yes, it needs to be its own case.

Kreation 02-06-2010 15:52

Re: How to make a back and next option on a menu
 
I found that you can use menu_setprop( menu, MPROP_NEXTNAME, "Next" )..
but what about the rest of the cases which go to the next page? Do I continue putting the cases under the menu_setprop, or above. For example.

PHP Code:

menu_additemmenu"Option 1""1")
menu_additemmenu"Option 2""2")
menu_setpropmenuMPROP_NEXTNAME"Next" )
menu_additemmenu"Option 3""3"

Would it be like that? or -- >

PHP Code:

menu_additemmenu"Option 1""1")
menu_additemmenu"Option 2""2")
menu_additemmenu"Option 3""3")
menu_setpropmenuMPROP_NEXTNAME"Next" 

And add all of the items above the prop..
Any help appreciated.

wrecked_ 02-06-2010 16:00

Re: How to make a back and next option on a menu
 
nvm

Kreation 02-06-2010 16:02

Re: How to make a back and next option on a menu
 
Ahh I didn't pay much attention to the 0, I'll do that now.. Thanks.

wrecked_ 02-06-2010 16:04

Re: How to make a back and next option on a menu
 
Completely disregard my last post, the last parameter in additem is the admin level needed to access it. I'll search in amxconst.inc, hold up.

wrecked_ 02-06-2010 16:09

Re: How to make a back and next option on a menu
 
PHP Code:

#define MEXIT_ALL      1    /* Menu will have an exit option (default)*/
#define MEXIT_NEVER  -1      /* Menu will not have an exit option */

#define MPROP_PERPAGE   1    /* Number of items per page (param1 = number, 0=no paginating, 7=default) */
#define MPROP_BACKNAME  2  /* Name of the back button (param1 = string) */
#define MPROP_NEXTNAME  3  /* Name of the next button (param1 = string) */
#define MPROP_EXITNAME  4  /* Name of the exit button (param1 = string) */
#define MPROP_TITLE  5        /* Menu title text (param1 = string) */
#define MPROP_EXIT    6  /* Exit functionality (param1 = number, see MEXIT constants) */
#define MPROP_NOCOLORS  8  /* Sets whether colors are not auto (param1 = number, 0=default) */
#define MPROP_NUMBER_COLOR  10    /* Color indicator to use for numbers (param1 = string, "\r"=default) */ 

There are the defines and comment parameters on the different setprops. I think it might make the next page on its own, not too sure though. Never had a menu with that many needed items.

Kreation 02-06-2010 16:16

Re: How to make a back and next option on a menu
 
Well, I am about to test it with 12 items. So we'll see if it makes the second page on its own.

Kreation 02-06-2010 16:52

Re: How to make a back and next option on a menu
 
Okay so I haven't got to see if it makes its own next page because when I type /shop it doesn't show up at all. Any ideas to why the menu wouldn't show up?


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

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