Connect Separate Plugins?
Well I'm creating a small custom shop plugin, containing various custom items from other plugins, such as a bazooka from ADV Baz/GiveBaz.
The problem is that I don't know how to connect one plugin to another for it to work, for instance: ===================== I want my shop plugin to give the player a bazooka ===================== I have my menu set up in the shop plugin and money, but I want it to give the player a bazooka without bringing the whole code from ADV Bazooka, instead just sending the function to the ADV Bazooka plugin to do it. *Problem Fixed. No need to post. |
Re: Connect Separate Plugins?
You could create dynamic natives in the bazooka plugin then use those natives in the other one. Last resort is to use callfunc natives.
|
Re: Connect Separate Plugins?
I added a native to the bazooka plugin ( native give_item_bazooka(id,ammo,sound) ) and used it into the shop plugin, but when i tried to compile, it did not work. The bazooka plugin itself had a few errors without me touching its other coding.
there were also 2 separate sources for bazooka advanced (to me, reasons unknown), but the way both of them give a bazooka is different. One uses the C4, and the other has the give_item_bazooka(which is the same thing i think but shorter) *EDIT: I got it to compile but i made give_item_bazooka its own .inc because when i tried in the bazooka plugin, it didn't compile due to 1 random error that popped up after i did add it in the plugin. But now that i added it as a .inc and then included it with my shop plugin, it compiles, but then when i tested in-game, my plugin wasn't working, i get bad load when i check it in amx_plugins. *EDIT #2: Problem with my shop plugin( i think ) is due to the bazooka .inc native, but im trying to add the native into the bazooka plugin and im getting error messages. Im setting the native up like this: PHP Code:
|
Re: Connect Separate Plugins?
PHP Code:
|
Re: Connect Separate Plugins?
|
Re: Connect Separate Plugins?
thanks Emp, I didn't really take a look at that thread nor found it in the first page of a search.
Ok I tried to follow that, but the plugin still doesn't load. PHP Code:
PHP Code:
PHP Code:
@Bugsy, its a function within Bazooka Advanced. |
Re: Connect Separate Plugins?
|
Re: Connect Separate Plugins?
Quote:
Its confusing/makes little sense to me from Hawk's tut. I don't know what im doing wrong with the natives. My Shop plugin DOES NOT LOAD when i use the natives. |
Re: Connect Separate Plugins?
Well, firstly, if it's register_library("bazookamod"), then you should be using #pragma reqlib "bazookamod". This way the plugin will at least load. Maybe reread the tutorial carefully?
Secondly, you should use register_native("give_item_bazooka","give_item_bazooka", 1) if you don't want to go through a rather messy process of reading params. It's deprecated, but in this case would be much easier. If you don't want to use this, then read the tutorial for how to read params and pass them properly to the give_item_bazooka function. And lastly, I'm not sure you should name the native the same as the function, and I have no idea if it works at all like that. |
Re: Connect Separate Plugins?
I wouldn't even use an include. Just put the native at the top of the plugin if it's going to be the only one and you never plan on using it without both plugins together. I did it this way for one of my example Polymorph add-on plugins so that it would compile online.
It's really up to you in this respect though. Just my two cents. The style 0 native method is not really all that confusing. |
| All times are GMT -4. The time now is 19:47. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.