Raised This Month: $51 Target: $400
 12% 

Multidimensional array


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 11-16-2014 , 11:14   Multidimensional array
Reply With Quote #1

Why it prints like

Quote:
1. 1 First
2. 2 First
3. 3 First
I want

Quote:
1. 1 First
2. 1 Second
3. 1 Third
4. 1 Fourth
PHP Code:
#define MAX_CATEGORIES 3

new const g_iMaxNames[MAX_CATEGORIES] = { 42};

new const 
g_szNames[][] =
{
    { 
"1 First""1 Second""1 Third""1 Fourth" },
    { 
"2 First""2 Second" },
    { 
"3 First""3 Second""3 Third""3 Fourth""3 Fiveth" }
};

// In menu

    
for (new 0g_iMaxNames[Selection]; i++)
    {
        new 
szItem[256];
        
formatex(szItemcharsmax(szItem), "%s"g_szNames[Selection][i]) // Know that problem is here, but I don't get it..

        
menu_additem(MenuszItem""0);
    } 

Last edited by ~Ice*shOt; 11-16-2014 at 13:41.
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
 



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


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