View Single Post
Re: New AMX Plug In For RealBot
Old
  (#13)
Terran
Member
 
Terran's Avatar
 
Status: Offline
Posts: 431
Join Date: Jan 2004
Default Re: New AMX Plug In For RealBot - 10-03-2004

Quote:
Originally Posted by Hacker Harry
hmm... is that documented somewhere?

Best Bytes®,
Harry
There is a tutorial about menus in the amxmod forums. Or look at the example scripts and study how they do it - like I did .

Well, it's very simple, the keys are defined via set bits in a variable:
Code:
   new keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<9)
   show_menu(id,keys,menuBody)
The "(1<<x)" is a simple bit-shifting operation. And as usual in programs the counting starts at 0 not at 1. Key "1" is 0, key "2" is 1 etc.
The "|" adds the keys together.

If you want key "1" and "0" enabled in your menu:
Code:
   new keys = (1<<0)|(1<<9)
  
Reply With Quote