Raised This Month: $12 Target: $400
 3% 

How to connect two plugins? Or Make subplugins.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheSpaniard
Senior Member
Join Date: Jul 2017
Location: Hell
Old 11-30-2017 , 10:33   How to connect two plugins? Or Make subplugins.
Reply With Quote #1

For example i have a ak47 skin menu plugin and another m4a1 skin menu plugin and i want to combine both without merging the code and making one big plugin.
I want to make a main plugin, which calls any plugin from those two when called.
Any help appreciated.
The Spaniard.
__________________
And I Am Back.
TheSpaniard is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 11-30-2017 , 10:48   Re: How to connect two plugins? Or Make subplugins.
Reply With Quote #2

U can use native.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
TheSpaniard
Senior Member
Join Date: Jul 2017
Location: Hell
Old 11-30-2017 , 10:50   Re: How to connect two plugins? Or Make subplugins.
Reply With Quote #3

Quote:
Originally Posted by EFFx View Post
U can use native.
How to use native to link two plugins can you give a example?
__________________
And I Am Back.
TheSpaniard is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 11-30-2017 , 11:09   Re: How to connect two plugins? Or Make subplugins.
Reply With Quote #4

read this: https://forums.alliedmods.net/showthread.php?t=41251 and then test countless amount of times
__________________
retired chump
DjSoftero is offline
TheSpaniard
Senior Member
Join Date: Jul 2017
Location: Hell
Old 11-30-2017 , 11:12   Re: How to connect two plugins? Or Make subplugins.
Reply With Quote #5

Quote:
Originally Posted by DjSoftero View Post
read this: https://forums.alliedmods.net/showthread.php?t=41251 and then test countless amount of times
lol that i have to do till my brain is throughly fucked still thanks for the tut.
__________________
And I Am Back.
TheSpaniard is offline
TheSpaniard
Senior Member
Join Date: Jul 2017
Location: Hell
Old 11-30-2017 , 11:30   Re: How to connect two plugins? Or Make subplugins.
Reply With Quote #6

Quote:
Originally Posted by DjSoftero View Post
read this: https://forums.alliedmods.net/showthread.php?t=41251 and then test countless amount of times
Now after reading it and not understanding 50% i think this isnt related.
i want it like this -

Main Plugin-
A menu to call the first and second plugin.

First plugin-
ak47 skins menu.

Second plugin-
m4a1 skins menu.

EDIT:- Now i get it. the whole plugin in an dynamic native and then calling it in the main plugin as a function. Brilliant.

EDIT2:- i think coding a whole big plugin in a native is a bad idea. too much work. working with a predefined function is ok. but this is insane almost 200 lines of simple code and making it into an native double it i think 400 line just to make one plugin another 400 lines to make another plugin and another 100 lines for the main plugin. its better to merge two of the plugin. Any alternative way?
__________________
And I Am Back.

Last edited by TheSpaniard; 11-30-2017 at 11:40.
TheSpaniard is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 11-30-2017 , 11:38   Re: How to connect two plugins? Or Make subplugins.
Reply With Quote #7

Create a clcmd for each menu and on the main one just call them.
Or create the hole menu in a header and call it whenever you want.(no data saves)[if the code is way to huge, don't follow this]
__________________

Last edited by Relaxing; 11-30-2017 at 11:43.
Relaxing is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 11-30-2017 , 14:21   Re: How to connect two plugins? Or Make subplugins.
Reply With Quote #8

in plugin for m4 you create a native player_equip_special_m4 or whatever
in plugin for ak47 you make player_equip_special_ak47
plugins only do what is needed for weapons like setting skin, sounds animations etc, maybe also remove on death or round end

in 3rd plugin, the actual menu, shop, or whatever plugin, you create your menus, all other logic (money price or XP or whatever) and when you need to give the player the weapon you just call the native

all info needed to do this is in the tutorial you were given above; but you can look at how natives work in a real example, just search for any AMXX API (like cs_set_player_team)
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.

Last edited by aron9forever; 11-30-2017 at 14:22.
aron9forever is offline
TheSpaniard
Senior Member
Join Date: Jul 2017
Location: Hell
Old 12-01-2017 , 00:14   Re: How to connect two plugins? Or Make subplugins.
Reply With Quote #9

Quote:
Originally Posted by Relaxing View Post
Create a clcmd for each menu and on the main one just call them.
Or create the hole menu in a header and call it whenever you want.(no data saves)[if the code is way to huge, don't follow this]
I know the clcmd method. But the code is self repeating cant help that. So anyone reading the clcmd method would definitely unapprove the plugin. And i dont care about my plugins coming in the approved or unapproved, In the end it still remains on the forum. My main concern is readability, no would like to read self repeating code code two times (the function of the both plugins being same but only for different weapons). And the debugging becomes hell lot harder.
__________________
And I Am Back.

Last edited by TheSpaniard; 12-01-2017 at 00:15.
TheSpaniard is offline
TheSpaniard
Senior Member
Join Date: Jul 2017
Location: Hell
Old 12-01-2017 , 00:19   Re: How to connect two plugins? Or Make subplugins.
Reply With Quote #10

Quote:
Originally Posted by aron9forever View Post
in plugin for m4 you create a native player_equip_special_m4 or whatever
in plugin for ak47 you make player_equip_special_ak47
plugins only do what is needed for weapons like setting skin, sounds animations etc, maybe also remove on death or round end

in 3rd plugin, the actual menu, shop, or whatever plugin, you create your menus, all other logic (money price or XP or whatever) and when you need to give the player the weapon you just call the native

all info needed to do this is in the tutorial you were given above; but you can look at how natives work in a real example, just search for any AMXX API (like cs_set_player_team)
So basically you are telling me to make the menu in the main plugin and handler in secondary plugin and how do you propose to link them?

EDIT:- I am a dumbass I got it i have to link them by the dynamic native
__________________
And I Am Back.

Last edited by TheSpaniard; 12-01-2017 at 00:20.
TheSpaniard is offline
Reply


Thread Tools
Display Modes

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 08:22.


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