How do I create a stock with optional parameters?
#1

I have this stock:

Код:
stock SS(playerid, color, eng[], ro[])
{
	if(playerVariables[playerid][pLang] == 0) //Ro
	{
		SCM(playerid, color, ro);
	}
	else if(playerVariables[playerid][pLang] == 1) //En
	{
		SCM(playerid, color, eng);
	}
	return 1;
}
If pLang == 0, it send the message ro[], else it sends the message eng[].
How can I make it so when you use: SS(playerid, COLOR_WHITE, "Test message");
it would send a normal message to the user, instead of checking if the variable is 0 or 1?
Reply


Messages In This Thread
How do I create a stock with optional parameters? - by danielpalade - 03.12.2016, 17:57
Re: How do I create a stock with optional parameters? - by Stinged - 03.12.2016, 18:04
Re: How do I create a stock with optional parameters? - by SickAttack - 03.12.2016, 18:13

Forum Jump:


Users browsing this thread: 1 Guest(s)