Using format in Stock
#1

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
Reply
#2

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)
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)