Define to Send Message
#1

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

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

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);
Reply
#4

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)