Raised This Month: $32 Target: $400
 8% 

Solved Passing array to menu_additem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
iNvectus
Member
Join Date: Sep 2014
Location: Bulgaria
Old 03-14-2019 , 05:42   Passing array to menu_additem
Reply With Quote #1

Greetings. I want to know if it is possible to pass an array to menu_additem.

Example:
PHP Code:
 #include <amxmodx>

 #define MAX_ZONES 25

 
new Float:fOrigin[MAX_ZONES][3];
 new 
g_iZones 5;
 
 public 
plugin_init()
 {
    
register_plugin("Test Menu""1.00""iNvectus");

    
register_clcmd"test","testMenu" );
 }

 public 
testMenuid )
 {
    new 
menu menu_create"\rPick option:""menu_handler" );
    
get_user_origin(idfOrigin[id], 0);

    for(new 
0g_iZonesi++)
        
menu_additem(menu"Test"fOrigin[i], 0);    // Is this possible, if yes, how to handle it in the menu handler?
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );
    
menu_displayidmenu);
   
   return 
PLUGIN_HANDLED;
 }
 
 public 
menu_handleridmenuitem )
 {
    if ( 
item == MENU_EXIT ) {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }
    new 
szData[33];
    new 
_accessitem_callback;

    
menu_item_getinfomenuitem_access, ?, ?, item_callback );

    
menu_destroymenu );
    return 
PLUGIN_HANDLED;
 } 

Last edited by iNvectus; 03-14-2019 at 13:45.
iNvectus 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 20:42.


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