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 i = 1; i < sizeof cmds; i++)
{
for(new a = 1; a < sizeof styles; a++)
{
formatex(string, charsmax(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!
__________________