AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Plz help whit menu (https://forums.alliedmods.net/showthread.php?t=51558)

exelz 02-20-2007 03:06

Plz help whit menu
 
can some one post a easy menu link on code.
I need to make a menu:
1.Armors
Opens:
1.Steel armor
2.Iron Armor
2.Weapons
Opens:
1.Steel Dagger
2.Iron Dagger

PLZ HELP!

[ --<-@ ] Black Rose 02-20-2007 10:27

Re: Plz help whit menu
 
MAN, is this your 50th thread?
Put it into one.

Look at other plugins, this is not the topic to get the code. This is where you post a code and someone can find problems with that. You don't even have a start for a code, this should be in suggestions or i suggest you learn how to code.

Squallkins 02-20-2007 16:14

Re: Plz help whit menu
 
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

Da_sk8rboy 02-20-2007 16:18

Re: Plz help whit menu
 
http://forums.alliedmods.net/showthr...highlight=menu
or
Menu Tutorial

Search Next time.


All times are GMT -4. The time now is 00:37.

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