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! */
}
}
__________________