SA-MP Forums Archive
Using format in Stock - 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: Using format in Stock (/showthread.php?tid=158293)



Using format in Stock - CAR - 09.07.2010

I want to Create A new stock like this:

SendClientStringMessage(playerid, color, message, formats);

I got this:
pawn Код:
stock SendClientStringMessage(playerid, color, const format[], {Float,_}:...)
{
    new constmsg[128];
    format(constmsg, sizeof(constmsg), const format, {Float,_}:...); // line 238
    SendClientMessage(playerid, color, constmsg);
}
But it's not working!
Erros/Warnings:

Код:
(238) : error 012: invalid function call, not a valid address
(238) : warning 215: expression has no effect
(238) : warning 215: expression has no effect
(238) : error 029: invalid expression, assumed zero
(238) : warning 215: expression has no effect
(238) : error 017: undefined symbol "Float"
(238) : fatal error 107: too many error messages on one line



Re: Using format in Stock - Grim_ - 09.07.2010

Just try these: (All credits for these functions to ******)
pawn Код:
new FALSE = false;
#define SendFormattedMessage(%0,%1,%2,%3) do{new _str[128]; format(_str,128,%2,%3); SendClientMessage(%0,%1,_str);}while(FALSE)
#define SendFormattedMessageToAll(%0,%1,%2) do{new _str[128]; format(_str,128,%1,%2); SendClientMessageToAll(%0,_str);}while(FALSE)



Re: Using format in Stock - CAR - 09.07.2010

Thank you and of course ******!