Registering Same Commands
Is there any problem with registering the same client commands in different plugins ?
For example, when a user typed the X command, two or more plugins must be called. Let's say, I have a plugin like this PHP Code:
and this PHP Code:
|
Re: Registering Same Commands
There is nothing wrong with it. Just note that if any of the plugins return PLUGIN_HANDLED, none of the other plugins will be called. You can use PLUGIN_HANDLED_MAIN to have the same effects as PLUGIN_HANDLED but still allow the other plugins to be called
|
Re: Registering Same Commands
Quote:
plugin1 plugin2 plugin3 all use the same command if plugin 2 has return PLUGIN_HANDLED at the end of the function the command calls, the command will no longer work for plugin 3 it goes on like this depending on their order in plugins.ini |
Re: Registering Same Commands
Yes. And to avoid this, use handled main, which will stop the function only for the current plugin.
|
Re: Registering Same Commands
Then, what is the difference between PLUGIN_HANDLED_MAIN and PLUGIN_CONTINUE
I suppose PLUGIN_CONTINUE stops the call for the current plugin, but lets the call continue to following plugins. So what does PLUGIN_HANDLED_MAIN differently from PLUGIN_CONTINUE |
Re: Registering Same Commands
Quote:
PLUGIN_HANDLED immediately stops execution of other handlers in plugins and mod dll / engine PLUGIN_HANDLED_MAIN halts the function from being called in the mod DLL or the engine(not from other plugins) PLUGIN_CONTINUE - default value - does nothing basically, you don't need it for simple stuff |
| All times are GMT -4. The time now is 09:48. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.