AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   check if other plugins are running? (https://forums.alliedmods.net/showthread.php?t=209873)

Blizzard_87 03-03-2013 03:54

check if other plugins are running?
 
in my menu system im running other plugins which work with my menu...

how do i fun a check to make sure the other plugin is running or not loaded?

im stuck...

for eg. how do i check if amx_shoopslay is running ?

YamiKaitou 03-03-2013 03:56

Re: check if other plugins are running?
 
You can use is_plugin_loaded, get_plugin, or find_plugin_byfile

Blizzard_87 03-03-2013 03:58

Re: check if other plugins are running?
 
thanks heaps i knew there must of been a way

EDIT:

ok stupid question howto use

is_plugin_loaded("amx_slay2", ??? )

then can it be used in a IF ?

YamiKaitou 03-03-2013 04:13

Re: check if other plugins are running?
 
Use either the filename or the Plugin Name (as specified in register_plugin)

Source

Blizzard_87 03-03-2013 04:24

Re: check if other plugins are running?
 
PHP Code:

    if(is_plugin_loaded("Admin Slay 2X"false))
    {
        
menu_additem(menu"Lightning Slay""3"0);
        
menu_additem(menu"Blood Slay""4"0);
        
menu_additem(menu"Explosion Slay""5"0);
    }
    else {
        
menu_additem(menu"\dLightning Slay""3"0);
        
menu_additem(menu"\dBlood Slay""4"0);
        
menu_additem(menu"\dExplosion Slay""5"0);
    } 

ok im still doing it wrong cos its not working.

ConnorMcLeod 03-03-2013 04:26

Re: check if other plugins are running?
 
PHP Code:

new g_iShoopSlayRunning

public plugin_cfg()
{
    
g_iShoopSlayRunning is_plugin_loaded("Shoop da Whoop Slay")


And if you plain to call public functions from this plugin with callfunc_XXX, cache function(s) index(es) at plugin_cfg in gloval vars to.

Blizzard_87 03-03-2013 04:47

Re: check if other plugins are running?
 
Quote:

Originally Posted by ConnorMcLeod (Post 1905584)
PHP Code:

new g_iShoopSlayRunning

public plugin_cfg()
{
    
g_iShoopSlayRunning is_plugin_loaded("Shoop da Whoop Slay")


And if you plain to call public functions from this plugin with callfunc_XXX, cache function(s) index(es) at plugin_cfg in gloval vars to.

thanks i'll test now :P

ConnorMcLeod 03-03-2013 04:56

Re: check if other plugins are running?
 
Your code was fine about plugin runing check, but instead of menu_additem, use menu_addtext


All times are GMT -4. The time now is 21:37.

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