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

Solved AddMenuItem, it once to add multiple items.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 08-14-2018 , 09:07   AddMenuItem, it once to add multiple items.
Reply With Quote #1

Hi, the title just says it all. If not; I'm trying to add a global string to AddMenuItem:
PHP Code:
char g_sSomeString[][][] =
{
    { 
"1""smth" },
    { 
"2""goes" },
    { 
"3""here" }
}; 
Just to give you an example:
I know this isn't correct.
PHP Code:
for (int i 1<= sizeof(g_sSomeString[]) - 1i++)
    
hMenu.AddItem(g_sSomeString[0][i], g_sSomeString[0][i]); 

Last edited by mug1wara; 08-14-2018 at 11:07.
mug1wara is offline
SHUFEN
Senior Member
Join Date: Jun 2014
Location: Japan, Tokyo
Old 08-14-2018 , 09:13   Re: AddMenuItem, it once to add multiple items.
Reply With Quote #2

Code:
for (int i = 0; i < sizeof(g_sSomeString); i++) 
    hMenu.AddItem(g_sSomeString[i][0], g_sSomeString[i][1]);
SHUFEN is offline
Send a message via Skype™ to SHUFEN
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 08-14-2018 , 11:07   Re: AddMenuItem, it once to add multiple items.
Reply With Quote #3

ty
mug1wara is offline
Reply



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 10:36.


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