Raised This Month: $ Target: $400
 0% 

Menu - Menu Callback [Advanced]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 04-13-2011 , 11:01   Menu - Menu Callback [Advanced]
Reply With Quote #1

i have problem with menu..
i folowed this "tutorial"
but i can't make it work

https://forums.alliedmods.net/archiv...p/t-98762.html

PHP Code:
public UseStrike(id)
{
    
menu_create("KS""test_show"
     
    
menu_additem(g_hMenu"UAV""1"
    
menu_additem(g_hMenu"Counter-UAV""2"
    
menu_additem(g_hMenu"AirStrike""3"_menu_makecallback("CallbackTest")) 
     
    
menu_setprop(g_hMenu,MPROP_EXITNAME,"Exit"
    
menu_display(idg_hMenu0
     
    return 
PLUGIN_HANDLED 


public 
CallbackTest(idMenuitem

    
//PROBLEM
    
if(item == 1)
    {
        if(
kill_counter[id]<3
            
return ITEM_DISABLED;
    }
    if(
item == 2)
    {
        if(
kill_counter[id]<4
            
return ITEM_DISABLED;
    }
    
///etc...


public 
test_show(idMenuitem

    if(
item == MENU_EXIT
    { 
        return 
PLUGIN_HANDLED 
    

     
    new 
iData[6
    new 
iAccess 
    
new iCallback 
    
new iName[64
     
    
menu_item_getinfo(MenuitemiAccessiData5iName63iCallback
     
    switch(
str_to_num(iData)) 
    { 
        case 
1
        { 
            
//code 1
        

        case 
2
        { 
            /
code 2 
        

        case 
3
        { 
            
//code 3
        

    } 
    return 
PLUGIN_HANDLED 

any one can fix it, menu doesn't work at all :S

first problem, my cvars ain't 0 or 1 like in tutorial, so i tried this way
but it doesn't work

edit: one more question
how to block radar for 15 second?

Last edited by OvidiuS; 04-13-2011 at 11:42.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
 



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


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