Raised This Month: $ Target: $400
 0% 

Plz help whit menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Squallkins
AlliedModders Donor
Join Date: Mar 2005
Old 02-20-2007 , 16:14   Re: Plz help whit menu
Reply With Quote #1

something like this perhaps:

Code:
//define includes and keys

#include <amxmodx>
#define MENUTIME 60
#define KEY1 (1<<0)
#define KEY2 (1<<1)
#define KEY3 (1<<2)
#define KEY4 (1<<3)
#define KEY5 (1<<4)
#define KEY6 (1<<5)
#define KEY7 (1<<6)
#define KEY8 (1<<7)
#define KEY9 (1<<8)
#define KEY0 (1<<9)

// Register Menu IDs
	new menu1ID = register_menuid("menu1");
	new menu2ID = register_menuid("menu2");
	new menu3ID = register_menuid("menu3");
		
// Register Menu Commands
	register_menucmd(menu1ID,1023,"menu1Action");
	register_menucmd(menu2ID,1023,"menu2Action");
	register_menucmd(menu3ID,1023,"menu3Action");



public plugin_init() {

//do the usual here

}


//Main menu display

public MainMenuDisplay(id) {
	new menubody[256];
	format(menubody,255,"\yExelz Armour Menu:^n^n");
	add(menubody,255,"\w1. Armours^n");
	add(menubody,255,"\w2. Weapons^n");
	add(menubody,255,"\w^n0. Exit");
	
	
	show_menu(id,KEY1|KEY2|KEY3|KEY4|KEY5|KEY6|KEY7|KEY8|KEY0,menubody,MENUTIME,"menu1");
	
	return PLUGIN_HANDLED;
}

//armours menu section

public ArmourMenuDisplay(id) {
	new menubody[256];
	format(menubody,255,"\yExelz Armour Menu:^n^n");
	add(menubody,255,"\w1. Steel Armour^n");
	add(menubody,255,"\w2. Iron Armour^n");
             add(menubody,255,"\w3. Main Menu^n");
             add(menubody,255,"\w^n0. Exit");
	
	
	show_menu(id,KEY1|KEY2|KEY3|KEY4|KEY5|KEY6|KEY7|KEY8|KEY0,menubody,MENUTIME,"menu2");
	
	return PLUGIN_HANDLED;
}

//weapons  menu section

public ArmourMenuDisplay(id) {
	new menubody[256];
	format(menubody,255,"\yExelz Armour/Weapon Menu:^n^n");
	add(menubody,255,"\w1. Steel Dagger^n");
	add(menubody,255,"\w2. Iron Dagger^n");
             add(menubody,255,"\w3. Main Menu^n");
             add(menubody,255,"\w^n0. Exit");
	
	
	show_menu(id,KEY1|KEY2|KEY3|KEY4|KEY5|KEY6|KEY7|KEY8|KEY0,menubody,MENUTIME,"menu3");
	
	return PLUGIN_HANDLED;
}



public menu1Action(id,key) {
	
		if(key == 0) {
//do something here

	}


		if(key == 1) {
//do something here

	}
//do for all keys

}


public menu2Action(id,key) {
	
		if(key == 0) {

//do something here
			}

//do for all keys

}


public menu3Action(id,key) {
	
		if(key == 0) {

//do something here
			}

//do for all keys

}

i missed some bits that u need to put in, other than that the menu part is complete
Squallkins 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 00:37.


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