What I'm trying to do is automatically transform a
client_print(id, print_chat, message[]) message in a
CC_SendMessage(id, message[]) function. So, I tried several methods:
PHP Code:
#define client_print(%1,%2,%3) CC_SendMessage(%1,%3)
This is correct, but it will work for all messages type, not only
print_chat.
PHP Code:
#define client_print(%1,print_chat,%3) CC_SendMessage(%1,%3)
This is also correct, but it works only if the function is written without spaces, which is very rarely the case.
PHP Code:
#define client_print CC_PrintTransform
stock CC_PrintTransform(const id, const iType, const szInput[], any:...)
{
if(iType != print_chat)
return
new szMessage[188]
vformat(szMessage, charsmax(szMessage), szInput, 4)
CC_SendMessage(id, szMessage)
}
This worked, but it will block all other print types.
So, I'm out of ideas. Is it possible to use some kind of a condition with the preprocessor, such as:
PHP Code:
#define client_print(%1,%2,%3) (if(%2 == print_chat) CC_SendMessage(%1,%3))
?
__________________