Raised This Month: $ Target: $400
 0% 

Solved Redefine client_print function with a condition


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-19-2017 , 10:50   Redefine client_print function with a condition
Reply With Quote #1

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(szMessagecharsmax(szMessage), szInput4)
    
CC_SendMessage(idszMessage)

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)) 
?
__________________

Last edited by OciXCrom; 03-19-2017 at 19:48.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Old 03-19-2017, 12:19
killerZM
This message has been deleted by killerZM. Reason: someone dont need it
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-19-2017 , 12:55   Re: Redefine client_print function with a condition
Reply With Quote #3

I explained perfectly well what I want.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 03-19-2017 , 14:48   Re: Redefine client_print function with a condition
Reply With Quote #4

Quote:
Originally Posted by OciXCrom View Post
I explained perfectly well what I want.
He's just trying to become a Veteran Member don't mind him.
__________________
edon1337 is offline
killerZM
Senior Member
Join Date: Sep 2016
Old 03-19-2017 , 16:17   Re: Redefine client_print function with a condition
Reply With Quote #5

Quote:
Originally Posted by edon1337 View Post
He's just trying to become a Veteran Member don't mind him.
haah , what ?i dont a care about a ;rank
@edit : i deleted the posts live in happiness now boy

Last edited by killerZM; 03-19-2017 at 16:51.
killerZM is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 03-19-2017 , 17:38   Re: Redefine client_print function with a condition
Reply With Quote #6

Quote:
Originally Posted by killerZM View Post
haah , what ?i dont a care about a ;rank
@edit : i deleted the posts live in happiness now boy
It doesn't bother me, lol.
__________________
edon1337 is offline
Old 03-19-2017, 13:22
killerZM
This message has been deleted by killerZM. Reason: none cares
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 03-19-2017 , 13:28   Re: Redefine client_print function with a condition
Reply With Quote #8

Quote:
Originally Posted by killerZM View Post
nope , i see nothin special just use normal client_print so or explain more .....
Quote:
Originally Posted by OciXCrom View Post
What I'm trying to do is automatically transform a client_print(id, print_chat, message[]) message in a CC_SendMessage(id, message[]) function
Thats all what you should know.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 03-19-2017 at 13:29.
EFFx is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-19-2017 , 13:51   Re: Redefine client_print function with a condition
Reply With Quote #9

Find and Replace with Regex.
__________________

Last edited by fysiks; 03-19-2017 at 13:52.
fysiks is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-19-2017 , 15:09   Re: Redefine client_print function with a condition
Reply With Quote #10

Find what, replace what? More information please. I have never used regex. And I'm asking if this can be done with a simple #define. I don't want to use any other includes for doing this.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode