Raised This Month: $ Target: $400
 0% 

menu_additem in for loop


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 05-20-2016 , 04:49   menu_additem in for loop
Reply With Quote #1

Hi,

I'm kinda stuck at a for loop.

PHP Code:
new const szCommands[][] = {
    
"1",
    
"2",
    
"3",
    
"4",
    
"5"

PHP Code:
for(new isizeof(szValues); i++) {
        
formatex(szDatacharsmax(szData), "%s - \r[%i$]"szValues[i], iPrices[i])
        
menu_additem(menuszDataszCommands[i])
    }
menu_display(idmenu
the szCommands[i] part in menu_additem should be done better, i just don't know how could someone help me a hand




Problem number 2:
i currently have this as my code and i know it could be done way much better, could someone help me out doing this with a loop?
PHP Code:
        case 0RollTheDice(id2510)
        case 
1RollTheDice(id5025)
        case 
2RollTheDice(id12550)
        case 
3RollTheDice(id250100)
        case 
4RollTheDice(id600200
__________________

Last edited by Napoleon_be; 05-20-2016 at 05:21.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
 



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 18:39.


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