Teoretical Help
Hi,
I've got only one question: What is the best way to make 2 or more plugins co-op? 1 - Put they into one plugin (in my case cca 4000 lines) 2 - Make a .inc file 3 - Ohter way ? thanks I know. My English is bad. |
Re: Teoretical Help
2 - Make a .inc file
|
Re: Teoretical Help
There are various possibilities:
- includes to share various constants on compile - natives, usefull for making functions that can be called from sub-plugins (requires a include file) - forwards, usefull if you want to hook something from the main plugin (I think it requries includes, see tutorials to be sure) - xvars to share variables to other plugins like pcvars, only that you set the variable in the main plugin rather than using functions, this method is fast and I think it doesn't require includes. - callfunc_* functions to call a function from a plugin, doesn't require a include or anything but I think it's pretty slow. And ofc server cvars and commands, but those aren't really internal. I belive you can change/remove tasks from another plugin, didn't really try it but there's a "outside" variable in change_task(), task_exists() and remove_task(). There are tutorials for all these methods. If you have somehing specific you want to make, please do tell so we can help you pick the most efficient methods. |
Re: Teoretical Help
Quote:
Quote:
It also does not make any sense to use natives to make plugins func together, there is already natives for variables and function calls between plugins, why would you write the natives again? You would write new natives only if you needed something you could not achieve in the plugin environment. In the end it is much easier to add the plugins to the same source code if there is a lot of common work to be done. In the other hand if the plugins are really separate and function something different forwards, functions and variables can indeed be used from and between separate plugins. ( By saying 'can be' I mean that there is available modules done already ) |
Re: Teoretical Help
Quote:
Quote:
You will only need to add #include <yourinclude> to the plugins rather than everything that is inside of them. Also, adding, deleting, and changing the contents of the include file would be much easier than to change all plugins that would use it. Quote:
However, natives do much more than just variable sharing, such as decisions. Quote:
If you were to keep them separate and develop some sort of API for extensions, it would be much easier for new extensions. |
Re: Teoretical Help
Big thanks to all, but I'm really confused now.
I remaking jailbreaks plugins now. I've got this plugins:(I'm sorry I don't going to share it, because I delete ML support and i think that nobody here can speek Czech or Slovak) JoRoPiTo's JailBreak Extreme (edited - mods, simon menu, last request, etc) MaNuCs's JailBreak Shop (edited and optimalized - extended and rewrited) JailBreak Football (I - Bafak) JailBreak FreeKill (I - Bafak) I have the .inc file which contains natives & stocks now. For example I can give JBPacks(in Shop) from FreeKill or JB extreme. But I think that if I make only one plugin it will be better, faster and less buggy. SO, what is the best way? Thanks |
Re: Teoretical Help
Quote:
Quote:
Quote:
|
Re: Teoretical Help
Quote:
Code:
date: Tue Jun 21 22:57:35 2011 map: de_dustPHP Code:
Code:
date: Tue Jun 21 23:07:41 2011 map: de_dustPHP Code:
PHP Code:
|
Re: Teoretical Help
I admit that you could achieve something with fake natives, but you must understand that they are really different from natives. I never neither did you talk about those, so obviously it is totally different thing.
|
Re: Teoretical Help
Quote:
If you weren't talking about callfuncs, then what were you talking about? |
| All times are GMT -4. The time now is 23:35. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.