[SUGGESTION] SendClientMessageEx
#1

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

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

@Garsino compare format + sendclientmessage to printf directly.
Reply
#4

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);
Reply
#5

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).
Reply
#6

http://pastebin.com/v6HGqmn7 Here you go
Something I have done when i was bored.
Reply
#7

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.
Reply
#8

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.
Reply
#9

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.
Reply
#10

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).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)