define replace
Is there any way to replace core native in the whole code with define?!
Example: Code:
|
Re: define replace
Don't add spaces in the first one and it should work
Code:
|
Re: define replace
It's a good idea actually but compiler will throw you a error "already defined"
Because there is client_print already defined as native. You can actually modify some symbols like replacing client_print with clientprint. Something like #define clientprint(%1, 0, %2) ColorChat(%1, GREEN, %2) But I am not sure you can do here" any:" parameter so you can format the string inside the function call. |
Re: define replace
Quote:
|
Re: define replace
Quote:
Also, Killer. It is possible.. I didn't read attentively... If you want to use only your stock than it's simple. Just go do amxmodx.inc from includes folder, find line native client_print (blabla...) and add double slash to comment it // So it won't be used by compiller and won't throw error after you add your define. So yes, it's possible, but only in case you are planning to use only your stock, without native client_print. |
Re: define replace
Quote:
PHP Code:
|
Re: define replace
And you can do
Code:
#define client_print(%0) whatever(%0)However, your example Code:
#define client_print(%1,print_chat,%2) color_print(%1, true, %2)Code:
client_print(0, print_chat, "");Code:
#define client_print(%0,%9print_chat%8,%1) color_print(%0, true, %1) |
Re: define replace
@KliPPy, Yes, you are right
Code:
#define client_print(%0,%9print_chat%8,%1) color_print(%0, true, %1)PHP Code:
PHP Code:
I tested this and it matches all of the examples. Code:
#define client_print(%0print_chat%1) color_print(%0true%1)
code
|
Re: define replace
The example that i had given seems to work but it's just that I hadn't tested it out yet.
@kristi, you are right and I will use your example, because it gonna match everything, thanks you. Code:
But I have another problem now. Actually I want to replace client_print native from war3ft mode with my custom stock for color message with included prefix instead to do it manually, cuz #define directive seems be easiest and fastest way. All chat message in the mode or at least those I've tested(when buying items) have added prefix, but isn't colored. Then И decided to do smoke test and added this in the test function provided by the plugin: Code:
But when I added this in the checks for user has enough money to buy an item even there was no prefix. Code:
WTF is happening guys?! :D |
Re: define replace
Thanks to helping me ;/
I found solution, #define must be in front of all includes. |
| All times are GMT -4. The time now is 09:55. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.