[SUGGESTION] SendClientMessageEx -
TheArcher - 19.10.2011
I'm pretty sure a lot of scripters are doing format + SendClientMessage for detect a function. Exemple
pawn Код:
format(output, 64, " This number is %d ", number);
then SendClientMessage to send the function to the text player. It will be more easly to do a function as printf but SendClientMessageEx instead. It's more useful, simply, faster. Ah and comatible with "strings", "integers" because are most used.
Re: [SUGGESTION] SendClientMessageEx - [03]Garsino - 19.10.2011
Quote:
Originally Posted by TheArcher
I'm pretty sure a lot of scripters are doing format + SendClientMessage for detect a function. Exemple
pawn Код:
format(arraysize, 64, " This number is %d ", number);
then SendClientMessage to send the function to the text player. It will be more easly to do a function as printf but SendClientMessageEx instead. It's more useful, simply, faster.
|
Lol, this can already be scripted and has been released on this forum a countless times already.
Re: [SUGGESTION] SendClientMessageEx -
TheArcher - 19.10.2011
@Garsino compare format + sendclientmessage to printf directly.
Re: [SUGGESTION] SendClientMessageEx -
FireCat - 19.10.2011
pawn Код:
#define SendFMessage(%0,%1,%2,%3) do{new _str[150]; format(_str,150,%2,%3); SendClientMessage(%0,%1,_str);}while(FALSE)
#define SendFMessageToAll(%1,%2,%3) do{new _str[190]; format(_str,150,%2,%3); SendClientMessageToAll(%1,_str);}while(FALSE)
new FALSE = false;
SendFMessageToAll(red,"Hello there %s",someformat);
Re: [SUGGESTION] SendClientMessageEx - [03]Garsino - 19.10.2011
pawn Код:
new FALSE = false, _ex_string[156];
#define SendClientMessageEx(%0,%1,%2,%3) do{format(_ex_string, 156,%2,%3); SendClientMessage(%0,%1,_str);}while(FALSE)
#define SendClientMessageToAllEx(%1,%2,%3) do{format(_ex_string, 156,%2,%3); SendClientMessageToAll(%1,_str);}while(FALSE)
EDIT: FireCat beat me to it (sorta, I was typing the post before he posted).
Re: [SUGGESTION] SendClientMessageEx -
i514x - 19.10.2011
http://pastebin.com/v6HGqmn7 Here you go
Something I have done when i was bored.
Re: [SUGGESTION] SendClientMessageEx -
AndreT - 19.10.2011
Ow guys, come on... I wouldn't encourage the usage of the defining method. Instead use the direct ways provided by ******. That code can be found in YSI and other various places and it is really useful and better than format+SendClientMessage.
Re: [SUGGESTION] SendClientMessageEx - [03]Garsino - 19.10.2011
Quote:
Originally Posted by AndreT
Ow guys, come on... I wouldn't encourage the usage of the defining method. Instead use the direct ways provided by ******. That code can be found in YSI and other various places and it is really useful and better than format+SendClientMessage.
|
But still; he get the point.
Re: [SUGGESTION] SendClientMessageEx -
i514x - 19.10.2011
I wouldn't recommend macros or function like that to anyone. What's so hard about format + SendClientMessage? If ur lazy and want your code less optimised then use it.
Re: [SUGGESTION] SendClientMessageEx - [03]Garsino - 19.10.2011
Quote:
Originally Posted by i514x_
I wouldn't recommend macros or function like that to anyone. What's so hard about format + SendClientMessage? If ur lazy and want your code less optimised then use it.
|
Lol, there isn't really any difference at all (depends on how you do it).