Raised This Month: $ Target: $400
 0% 

Menu, is it possible?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 09-10-2013 , 08:42   Menu, is it possible?
Reply With Quote #1

I want to ask is it possible to remove/hide numbers in new menu system?
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 09-10-2013 , 11:00   Re: Menu, is it possible?
Reply With Quote #2

Explain further. Do you want to skip certain numbers? Is there a specific reason?
__________________
Black Rose is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 09-10-2013 , 11:45   Re: Menu, is it possible?
Reply With Quote #3

I want to hide all numbers except 8, 9 and 0 - next/back and exit

Quote:
Your menu:

First
Second
....

8. Back
9. Next
0. Exit
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 09-10-2013 , 13:12   Re: Menu, is it possible?
Reply With Quote #4

menu_addtext() or do you actually need the buttons working?
__________________

Last edited by Black Rose; 09-10-2013 at 13:12.
Black Rose is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 09-10-2013 , 13:25   Re: Menu, is it possible?
Reply With Quote #5

I know menu_addtext() but it's must be after menu_additem, isn't? That hidden buttons no need to work.
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 09-10-2013 , 13:47   Re: Menu, is it possible?
Reply With Quote #6

Then just use the old menu style.
__________________
Black Rose is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 09-10-2013 , 21:44   Re: Menu, is it possible?
Reply With Quote #7

It's possible to do a menu without numbers.
__________________
Like my clean plugins and work?
Baws is offline
dark_style
Senior Member
Join Date: Jul 2009
Location: Bulgaria
Old 09-11-2013 , 00:44   Re: Menu, is it possible?
Reply With Quote #8

Quote:
Originally Posted by baws View Post
It's possible to do a menu without numbers.
The new amxx menu system automatically adds the numbers, so as Black Rose said, he must use the old menu.
__________________



dark_style is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 09-11-2013 , 08:22   Re: Menu, is it possible?
Reply With Quote #9

OK, but how then create pages in old menu style?
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-11-2013 , 10:05   Re: Menu, is it possible?
Reply With Quote #10

To create pages in old menu style:
First define the keys for each option:
#define Keysrod (1<<0)|(1<<1)|(1<<2) etc.It depends on the number of options that you add into the menu.

In public plugin_init() add this
register_menucmd(register_menuid("rod"), Keysrod, "Pressedrod")
register_clcmd("say /menu" , "Showrod")

Then make a public called Showrod

public Showrod(id) {
show_menu(id, Keysrod, "Menu_title^n\w1. Option 1 ^n\w2. Option 2^n0. Exit^n", -1, "rod")
}
public Pressedrod(id, key) {

switch (key) {
case 0: {
//do something. I'm option 1

}
case 1: {
//do something. I'm option 2

}

}
}

At the end you cand use this block of code into your plugin:

Code:
#include <amxmodx>

#define Keysrod (1<<0)|(1<<1)|(1<<2)

public plugin_init() {
	register_menucmd(register_menuid("rod"), Keysrod, "Pressedrod")
	register_clcmd("say /menu" , "Showrod")
	
	
}
public Showrod(id) {
	show_menu(id, Keysrod, "Menu_title^n\w1. Option 1 ^n\w2. Option 2^n0. Exit^n", -1, "rod")
}
public Pressedrod(id, key) {
	
	switch (key) {
		case 0: { 
			//do something. I'm option 1
			
		}
		
		case 1: { 
			//do something. I'm option 2
			
		}
		
	}
}
This was an example for this style menu. I didn't want to bore you with lessons.

Last edited by HamletEagle; 09-11-2013 at 10:06.
HamletEagle 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 18:48.


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