Quote:
Originally Posted by Mencent
Hello!
You can realize that like this:
PHP код:
stock function1(color1[],color2[])
{
new string[144],s1[10],s2[10];
if(!strcmp(color1,"red",true))format(s1,sizeof(s1),"ef3f23");
if(!strcmp(color2,"green",true))format(s2,sizeof(s2),"476e15");
format(string,sizeof string,"{%s} Hello,{%s} this is a test message!",s1,s2);
SendClientMessageToAll(-1,string);
return 1;
}
So, you have the choice between red and green. Of yourse, you can insert more colours.
|
That's just a waste of memory.
If you want to make a function like that, you just just use a macro.