%s in SendClientMessage
#17

Quote:
Originally Posted by Skyrise
Посмотреть сообщение
I did not make this. It was provided to me by Emmet_.

SendClientMessageEx(playerid, -1, "%s is a derp.",pName(playerid));

pawn Код:
stock SendClientMessageEx(playerid, color, const string[], { Float, _ }: ...)
[...]
A friend of mine made this:
Код:
new FALSE = false;
#define SendClientFormattedMessage(%0,%1,%2) do{new _str[128]; format(_str,128,%2); SendClientMessage(%0,%1,_str);}while(FALSE)
#define SendClientFormattedMessageToAll(%1,%2,%3) do{new sendfstring[128];format(sendfstring,128,(%2),%3);SendClientMessageToAll((%1),sendfstring);}while(FALSE)
Which is much shorter and quicker. I think it can still be optimized, though. There's a loop in it, to make sure the "new _str;" doesn't give errors when using this function multiple times in a row. But it might be replaceable with "if (true)" or something similar, or just brackets.
Reply


Messages In This Thread
%s in SendClientMessage - by Dan.. - 13.01.2013, 09:18
Re: %s in SendClientMessage - by Kwarde - 13.01.2013, 09:49
Re: %s in SendClientMessage - by CaHbKo - 13.01.2013, 10:24
Re: %s in SendClientMessage - by TheArcher - 13.01.2013, 13:06
Re: %s in SendClientMessage - by Dan.. - 13.01.2013, 13:41
Re: %s in SendClientMessage - by TheArcher - 13.01.2013, 14:11
Re: %s in SendClientMessage - by Skyrise - 16.01.2013, 02:34
Re: %s in SendClientMessage - by mastermax7777 - 16.01.2013, 05:03
Re: %s in SendClientMessage - by Neil. - 16.01.2013, 07:05
Re: %s in SendClientMessage - by RajatPawar - 16.01.2013, 07:11
Re: %s in SendClientMessage - by leong124 - 16.01.2013, 08:13
Re: %s in SendClientMessage - by Kwarde - 16.01.2013, 12:20
Re: %s in SendClientMessage - by kaisersouse - 16.01.2013, 12:43
Re: %s in SendClientMessage - by leong124 - 16.01.2013, 13:59
Re: %s in SendClientMessage - by liquor - 22.01.2013, 20:12
Re: %s in SendClientMessage - by RootKiller - 22.01.2013, 21:02
Re: %s in SendClientMessage - by Basssiiie - 22.01.2013, 22:03
Re: %s in SendClientMessage - by TheArcher - 22.01.2013, 22:29
Re: %s in SendClientMessage - by leong124 - 23.01.2013, 06:54
Re: %s in SendClientMessage - by Basssiiie - 23.01.2013, 21:40
Re: %s in SendClientMessage - by Dan.. - 24.01.2013, 14:25
Re: %s in SendClientMessage - by leong124 - 24.01.2013, 15:10

Forum Jump:


Users browsing this thread: 2 Guest(s)