Raised This Month: $ Target: $400
 0% 

Acquiring a #define from another plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 07-16-2008 , 17:33   Re: Acquiring a #define from another plugin
Reply With Quote #2

This is how I would do it.
I will create a forward that will execute after the plugins have been loaded in the main plugin that holds the defines.

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define DEFINE 4

#define PLUGIN    "Fake Forward"
#define AUTHOR    "OT"
#define VERSION    "1.0"

new g_forward
new g_return

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
g_forward CreateMultiForward("api_get_the_defines",ET_IGNORE,FP_CELL)
    
set_task(0.5,"plugin_spread_defines")
}

public 
plugin_spread_defines()
{
    
ExecuteForward(g_forward,g_return,DEFINE)
    
    
DestroyForward(g_forward)

To hook the forward in your plugins you need to put the function name
PHP Code:
public api_get_the_defines(define)
{
      
define

Anyway this will be helpfull -> PLUGIN API TUTORIAL
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
 



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 05:32.


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