Raised This Month: $ Target: $400
 0% 

[Question] Null parameter constant, loop inside a loop


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 06-18-2014 , 14:23   [Question] Null parameter constant, loop inside a loop
Reply With Quote #1

Hey, I wanted to ask you here two questions, far far different. I know that on oe thread there should be one topic, but these questions are pretty little and not that improtant (and people here don't like giving PM support, so...) and I thought it would be better to put them in one thread isntead of flooding with useless threads. But anyways, if it's problem, I'll post nother thread.

The first question is if there is some problem with making a loop inside another loop? I'm asking this, beacuse sometimes I want to combine two constants in one and I have to use two loops inside, one inside the other. Giving example:
PHP Code:
new const cmds[][]= 

    
""
    
"hegrenade"
    
"grenade"
    
"he"
    
"gren"
    
"bomb" 


new const 
styles[][]= 

    
""
    
"say "
    
"say /"
    
"say_team "
    
"say_team /" 


new 
string[64

public 
plugin_init() 

        for(new 
1sizeof cmdsi++) 
        { 
            for(new 
1sizeof stylesa++) 
            { 
                 
formatex(stringcharsmax(string), "%s%s"styles[a], cmds[i]) 
                 
register_clcmd(string"hegrenade"
            } 
        } 

Is there any problem with that one?

And the second question I want to know just for information - does living a null parameter in a constant matter with something? I mean, that empty space that is used as a null parameter in the constants so often. I ask this, beacause the arrays also start from index 0, like the constants. Does this null parameter mean with something?
PHP Code:
new const styles[][]= 

    
""//We are talking about that empty parameter here...
    
"say "
    
"say /"
    
"say_team "
    
"say_team " 

Any information is appereciated! Thanks!
__________________

Last edited by Flick3rR; 06-18-2014 at 15:31.
Flick3rR is offline
Send a message via Skype™ to Flick3rR
 



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 21:13.


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