Raised This Month: $ Target: $400
 0% 

new const need help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
manfailui
Member
Join Date: Jun 2012
Location: Hong Kong
Old 09-29-2012 , 12:17   new const need help
Reply With Quote #1

hi everybody.this is my first post..
i come from hong kong...my eng is so poor...
Please forgive me
-----------------------------------------
PHP Code:
#define MAX_ITEM_TYPE 3

new const item_name[MAX_ITEM_TYPE][] =
{
    
a,
    
b,
    
c
}

new const 
item_type[][] =
{
    
code_a,
    
code_b,
    
code_c
}

public 
code_a(id)
{
    
user_kill(id)
}

public 
code_b(id)
{
    
client_print(idprint_chat"you're choose the item b")
}

public 
code_c(id)
{
    
give_item(id"weapon_ak47")

i want to use menu make it work

like this

PHP Code:
public top_menu(id)
{
    new 
szInfo[60]
    new 
szTempid[32]
    
    
formatex(szInfo59"menu")
    new 
menu menu_create(szInfo "top_menu2")
    
    for(new 
0MAX_ITEM_TYPEi++)
    {
        new 
szItems[60]
        
formatex(szItems59"&s"item_name[i])
        
num_to_str(iszTempid31)
        
menu_additem(menuszItemsszTempid0)
    }
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
menu_display(idmenu0)
    
    return 
PLUGIN_HANDLED
}

public 
top_menu2(id menu item
{
    if(
item == MENU_EXIT)
    return 
PLUGIN_HANDLED
    
    
new data[6], iName[64]
    new 
accesscallback
    menu_item_getinfo
(menuitemaccessdata,5iName63callback)

    new 
str_to_num(data)
    
    
item_type[id][i//<------here..=_=
    
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED

But it is sure not work
who can help me and make it work
thank you

Last edited by manfailui; 09-29-2012 at 12:44.
manfailui is offline
 


Thread Tools
Display Modes

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 08:19.


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