SA-MP Forums Archive
Define to Send Message - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Define to Send Message (/showthread.php?tid=94111)



Define to Send Message - Typhome - 28.08.2009

pawn Код:
#define FORUM "lsrp.smfnew.com"
pawn Код:
SendClientMessage(playerid, COLOR_WHITE, "Foorum: %s",FORUM);
Код:
warning 202: number of arguments does not match definition



Re: Define to Send Message - dice7 - 28.08.2009

pawn Код:
new string[30];
format(string, sizeof(string),"Forum: %s", FORUM);
SendClientMessage(playerid, COLOR_WHITE, string);
https://sampwiki.blast.hk/wiki/Format


Re: Define to Send Message - kevin974 - 28.08.2009

You cannot use define's in ClientMessage try this.

Код:
new FALSE = false;
#define SendFormattedMessage(%0,%1,%2) do{new _str[128]; format(_str,128,%2); SendClientMessage(%0,%1,_str);}while(FALSE)
and use it like this.
Код:
#define FORUM "lsrp.smfnew.com"
SendFormattedMessage(playerid,COLOR_WHITE"Forum: %s", FORUM);



Re: Define to Send Message - dice7 - 28.08.2009

Quote:
Originally Posted by kevin974
You cannot use define's in ClientMessage try this.
Why not? They work perfectly fine with me


Re: Define to Send Message - Zeex - 28.08.2009

pawn Код:
// you don't need to use format() because FORUM is constant
SendClientMessage(playerid, COLOR_WHITE, "Forum: " FORUM);