AlliedModders

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

[C]oN -X- 11-09-2005 00:35

menus
 
hey as i read like 5 min ago on a bots-united.. a kid was gonna make a bot menu for his dedicated

this is his commands

epb addbot 2 - will add a bot in ct
epb addbot 1 - will add a bot in t
epb addbot - will add a bot in a team
epb killbots - will kill all bots
epb removebots - will kick all bots
epb jasonmode on - bots use only knife

he said he was putting it a commandmenu.txt

im a little noob up to this point..

since i wonna do the same... what exactly do i do...

make a commandmenu.txt put

epb addbot 2 - will add a bot in ct
epb addbot 1 - will add a bot in t
epb addbot - will add a bot in a team
epb killbots - will kill all bots
epb removebots - will kick all bots
epb jasonmode on - bots use only knife

in it... and then in game do bind key commandmenu

right??

Kensai 11-09-2005 00:37

Bots, and AMXX coding are....different.

Look into the Doc, and look at some plugins with menus.

[C]oN -X- 11-09-2005 00:41

bah
 
bah i know its all different but can u tell me how to do it :-/[/i]

Kensai 11-09-2005 00:49

Start with this in your plugin_init:

Code:
register_menucmd(register_menuid("menu_NAMEHERE"),1023,"DoNAMEHERE");

You also need someway to go to the menu. Let's use a say command.

Code:
register_clcmd("say /menu","NAMEHERE")//Normal chat     register_clcmd("say_team /menu","NAMEHERE")//Team chat

Then make a public, to format the menu.

Code:
public NAMEHERE(id)     {           new menu[192]       format(menu, 191, "TITLE: WHAT TO DO^n1. Option 1^n2. Option 2^n3 Option 3^n^n0. Exit")         new keys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_0     show_menu(id, keys, menu, 15, "menu_NAMEHERE")             return PLUGIN_HANDLED }


Then we need to define the "cases" or what happens when a button is pressed.


Code:
public DoChooseType(id, key)     {         if(key == 0) {                 //Code here for Option 1     }                 if(key == 1) {                 //Code here for Option 2     }         if(key == 2) {                 //Code here for Option 3     }             if(key == 0) {         //This Exits the Menu, when they hit Exit.         return PLUGIN_HANDLED     }         return PLUGIN_HANDLED }


All times are GMT -4. The time now is 23:39.

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