SA-MP Forums Archive
Have warning - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Have warning (/showthread.php?tid=640115)



Have warning - TYDS - 28.08.2017

warning 202: number of arguments does not match definition

Код:
#define SSM(%0,%1) \
	SendClientMessage(%0, COLOR_SERVER, "[SERVER]:{FFFFFF} "%1)
Код:
new name[MAX_PLAYERS];
				GetPlayerName(playerid, name, sizeof(name));
				SSM(playerid, "Chao Mung Ban Tro Lai {FFFF00}%s", name); // error line



Re: Have warning - Vince - 28.08.2017

The fact that you created a macro doesn't change anything about the fact that you still need to format() said message.


Re: Have warning - 10MIN - 28.08.2017

Download YSI includes (by pressing the Download button)
Then you need to put it in pawno/includes.
Then you need to include y_va.inc like:
Код:
//after a_samp
#include <[PATH_TO_Y_VA(from YSI folder)]/y_va> //Remember to change the thing that is underlined
And now declare a function like:
Код:
SSM(playerid,color,fmat[],va_args<>)
{
    new msg[100];
    va_format(msg,sizeof(msg),fmat,va_start<3>); // 3 represents the number of arguments before va_args
    return SendClientMessage(playerid,color,msg);
}