Quote:
Originally Posted by Shadows Adi
Yea, it's possible, because:
First you create an array which let say will hold 33 cells ( new szCommands[33] )
Then, you create a new array which will have the value sizeof(szCommands) which will be 33 cells lenght, so practically this is same as new szTemp[33], but less hardcoded, if it's value depends on szCommands lenght.
|
What if i don't declare the length? It'd look something like this.
PHP Code:
new const szCommands[][] = {
"/glowmenu",
"/gm",
"/glow",
"!glowmenu",
"!gm",
"!glow"
};
PHP Code:
new szTemp[sizeof(szCommands)];
for(new i; i < sizeof(szCommands); i++) {
formatex(szTemp, charsmax(szTemp), "say %s", szCommands[i]);
register_clcmd(szTemp[i], "checkSettings");
}
__________________