Raised This Month: $ Target: $400
 0% 

A question about AMXX menus


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Hades
New Member
Join Date: Jul 2004
Old 07-01-2004 , 02:09   A question about AMXX menus
Reply With Quote #1

Okay well im designing a couple plugins and im not new to coding at all. But, I cant seem to find the link between the formatting/showing of the menu with the show_menu function and how it relates that to the register_menu function.

So, lets say I format the menu like this:
Code:
public example_menu(id) {     new menu_msg[256]     format(menu_msg,255,"\yThis is just an Example\w^n^n1. Option 1^n2. Option 2^n3. Option 3")     show_menu(id,(1<<0)|(1<<1)|(1<<2),menu_msg,-1)     return PLUGIN_CONTINUE }
Then I register the menu here (plugin_init):
Code:
register_menucmd(register_menuid("\yThis is just an example"),(1<<0)|(1<<1)|(1<<2),"do_example")
That then links to my function that links an action with the key pressed:
Code:
public do_example(id, key) {     client_cmd(id,"echo You chose option %d",key)     return PLUGIN_HANDLED }

How does the first set of code know which menu command to run?
Hades is offline
 



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 14:45.


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