Raised This Month: $ Target: $400
 0% 

Menu System


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 02-04-2012 , 08:43   Menu System
Reply With Quote #1

We review how to create a menu.
However, fail to compile.
Is there a mistake where?

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("Choose Menu""1.0.0""AMX Mod X")


    
register_clcmd"choose_menu""create_choose_menu")

    
register_dictionary("choose_menu.txt")
}

public 
create_choose_menu(id)
{
    new 
menu menu_create("%L""CHOOSE_MENU_NAME""show_choose_menu")

    
menu_additem(menu"%L""CHOOSE_MENU_ITEM_1""1"0)
    
menu_additem(menu"%L""CHOOSE_MENU_ITEM_2""2"0)
    
menu_additem(menu"%L""CHOOSE_MENU_ITEM_3""3"0)

    
menu_addblank(menu)

    
menu_addtext(menu"%L""CHOOSE_MENU_TEXT")

    
menu_display(idmenu0)
}

public 
show_choose_menu(idmenuitem)
{
    new 
data[6], szName[64]
    new 
accesscallback

    menu_item_getinfo
(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback)

    new 
key str_to_num(data)

    switch(
key)
    {
        case 
1:
        {
            
client_print(idprint_chat"%L""CHOOSE_MENU_MESSAGE_1")
        }
        case 
2:
        {
            
client_print(idprint_chat"%L""CHOOSE_MENU_MESSAGE_2")
        }
        case 
3:
        {
            
client_print(idprint_chat"%L""CHOOSE_MENU_MESSAGE_3")
        }
    }
    
menu_destroy(menu)

    return 
PLUGIN_HANDLED

RuRuRu612754 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 22:53.


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