Parameters in a define
#6

If i can do this SCMEx withouth 'color' parameter, it can be good. But i can't, beasuse if I am remove the 'color' its dosent format my string.. Whetst the reason because i want to do it with #define

Here is it:

Код:
stock SendClientMessageEx(playerid, color, const text[], {Float, _}:...)
{
	static
	    args,
	    str[144];

	/*
     *  Custom function that uses #emit to format variables into a string.
     *  This code is very fragile; touching any code here will cause crashing!
	*/
	if ((args = numargs()) == 3)
	{
	    SendClientMessage(playerid, color, text);
	}
	else
	{
		while (--args >= 3)
		{
			#emit LCTRL 5
			#emit LOAD.alt args
			#emit SHL.C.alt 2
			#emit ADD.C 12
			#emit ADD
			#emit LOAD.I
			#emit PUSH.pri
		}
		#emit PUSH.S text
		#emit PUSH.C 144
		#emit PUSH.C str
		#emit PUSH.S 8
		#emit SYSREQ.C format
		#emit LCTRL 5
		#emit SCTRL 4

		SendClientMessage(playerid, color, str);

		#emit RETN
	}
	return 1;
}
Reply


Messages In This Thread
Parameters in a define - by n00el - 02.08.2016, 01:52
Re: Parameters in a define - by Luicy. - 02.08.2016, 02:03
Re: Parameters in a define - by AndySedeyn - 02.08.2016, 02:08
Re: Parameters in a define - by n00el - 02.08.2016, 10:19
Re: Parameters in a define - by Luicy. - 02.08.2016, 11:16
Re: Parameters in a define - by n00el - 02.08.2016, 11:40
Re: Parameters in a define - by Stinged - 02.08.2016, 11:46
Re: Parameters in a define - by n00el - 02.08.2016, 11:48
Re: Parameters in a define - by n00el - 02.08.2016, 12:03
Re: Parameters in a define - by Nero_3D - 02.08.2016, 21:03

Forum Jump:


Users browsing this thread: 2 Guest(s)