SA-MP Forums Archive
help me for 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)
+--- Thread: help me for message (/showthread.php?tid=554029)



help me for message - Cr3dO - 01.01.2015

PHP код:
SendClientMessage(playeridCOLOR_BLUE"Come in %s."robberyPlace(playerid)); 
warning 202: number of arguments does not match definition


Re: help me for message - Sledgehammer - 01.01.2015

pawn Код:
new string[128];
format(string, sizeof(string), "Come in %s.", robberyPlace(playerid));
SendClientMessage(playerid, COLOR_BLUE, string);



Re: help me for message - AndySedeyn - 01.01.2015

Quote:
Originally Posted by Cr3dO
Посмотреть сообщение
PHP код:
SendClientMessage(playeridCOLOR_BLUE"Come in %s."robberyPlace(playerid)); 
warning 202: number of arguments does not match definition
The code above should work.
I just want to tell you that you should never use a specifier inside a SendClientMessage, it will simply crash your server when the message is being showed. Use format to add specifiers in a SendClientMessage just like in the code above this post.

More about this on the wiki:
https://sampwiki.blast.hk/wiki/Format


Re: help me for message - Cr3dO - 01.01.2015

fixed


Re: help me for message - Ahmad45123 - 01.01.2015

Or you can use this to speed it up :
pawn Код:
new FALAE = false;
#define SendFormattedMessage(%0,%1,%2) do{new _str[128]; format(_str,128,%2); SendClientMessageEx(%0,%1,_str);}while(FALAE)
So you'd do :
pawn Код:
SendFormattedMessage(playerid, COLOR_BLUE, "Come in %s.", robberyPlace(playerid));