From 918e1c3195ffe4a82b2626e0bee7c60277fa71f1 Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Wed, 13 Sep 2006 13:44:37 +0000 Subject: [PATCH] Better, but still not perfect. :( --- plugins/amxmod_compat/core.sma | 4 ++-- plugins/include/amxmod_compat/amxmod.inc | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/plugins/amxmod_compat/core.sma b/plugins/amxmod_compat/core.sma index d1595a58..decb0909 100644 --- a/plugins/amxmod_compat/core.sma +++ b/plugins/amxmod_compat/core.sma @@ -288,7 +288,7 @@ public __is_module_running(plid, num) get_string(1, module, 63) - return is_module_loaded(module) + return is_module_running(module) } public __is_plugin_running(plid, num) @@ -297,5 +297,5 @@ public __is_plugin_running(plid, num) get_string(1, plugin, 63) - return is_plugin_loaded(plugin) + return is_plugin_running(plugin) } diff --git a/plugins/include/amxmod_compat/amxmod.inc b/plugins/include/amxmod_compat/amxmod.inc index 99dd92de..94019166 100644 --- a/plugins/include/amxmod_compat/amxmod.inc +++ b/plugins/include/amxmod_compat/amxmod.inc @@ -297,12 +297,22 @@ stock get_plugincvarsnum(plugin[], flags=0) return cvars_total; } -stock is_module_running(const plugin[]) +stock is_module_running(const module[]) { - return is_module_loaded(plugin); + if (strcmp(module, "MySQL Access") == 0) + return LibraryExists("sqlx", LibType_Class); + + return is_module_loaded(module) == -1 ? 0 : 1; } stock is_plugin_running(const plugin[]) { - return is_plugin_loaded(plugin); + new status[8] + new id, filename[1], name[1], version[1], author[1] + + id = is_plugin_loaded(plugin) + + get_plugin(id, filename, 0, name, 0, version, 0, author, 0, status, 7) + + return strcmp(status, "running") == 0 ? id + 1 : 0 }