This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Communicating Plugins with each other?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 07-25-2015 , 17:36   Communicating Plugins with each other?
Reply With Quote #1

I'm not sure how to properly call it or if something like this exists..
Example: We have 2 decompiled plugins (.sma), 1 is testone and the other testtwo.. so we write this for example in testone:

PHP Code:
#include <amxmodx>

#define PLUGIN "Test One"
#define VERSION "1.0"
#define AUTHOR "k"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /test""cmd_test")

and in testtwo:

PHP Code:
#include <amxmodx>

#define PLUGIN "Test Two"
#define VERSION "1.0"
#define AUTHOR "k"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
cmd_test(id)
{
    
client_print(idprint_chat"[AMXX] Test!!! 1... 2... 3...")

Do you get my point?

In one plugin (testtwo) you have a function that prints out a message... but don't have a command to execute it, in the other plugin (testone) you have a registered command but no function.
I'm pretty sure the title of this thread says it.. if testone and testtwo are running on a server.. typing /test in chat will print out the message written in testtwo.. does something like this even exist? Is it possible to build something like this? Kinda is useful for already existing mods.. for example in jailbreak there is a function that gives the player a crowbar.. but you can only get it with already existing techiques that exist in the jailbreak plugin itself: buy it from the shop, become alien...

And what if for example i just want to make another shop plugin not similar to the one in jailbreak, and if i choose an menu item it gives me a crowbar (Simply make a menu plugin and inside a case for the menu item i put the function name that belongs in the jailbreak plugin instead of writing everything for the crowbar in here)

Last edited by redivcram; 07-25-2015 at 17:37.
redivcram is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-25-2015 , 21:45   Re: Communicating Plugins with each other?
Reply With Quote #2

Dynamic Natives
__________________
fysiks is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 07-26-2015 , 05:57   Re: Communicating Plugins with each other?
Reply With Quote #3

Alright thanks, just what i needed.
Hope didn't annoy any of you for being a noob... I didn't even know something like that existed and what It's called
redivcram is offline
Reply



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 13:36.


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