View Single Post
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 12-21-2017 , 17:23   Re: Plugin late load
Reply With Quote #9

Something like:

PHP Code:
bool g_bCoreLoaded false;

public 
OnAllPluginsLoaded()
{
    if (
LibraryExists("some_fancy_core"))
    {
        
g_bCoreLoaded true;
    }
}

public 
void OnLibraryAdded(const char[] name)
{
    if (
StrEqual(name"some_fancy_core"))
    {
        
g_bCoreLoaded true;
    }
}

public 
void OnLibraryRemoved(const char[] name)
{
    if (
StrEqual(name"some_fancy_core"))
    {
        
g_bCoreLoaded false;
    }
}

public 
YourFancyFunctionHere()
{
    if (
g_bCoreLoaded) {
        
/* YAY! We got our core, ... do what you need to do here! */
    
}
    else
    {
        
/* Ohhh no, core is missing, do what you need to do here! */
    
}

__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline