Raised This Month: $ Target: $400
 0% 

detect plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sanjay Singh
Veteran Member
Join Date: Sep 2016
Old 01-10-2020 , 07:15   detect plugin
Reply With Quote #1

how can I detect plugin if its running or not.

I want to enable func only when that plugin is running.

PHP Code:
plugin_running()
    
func_mod()
else
    return 
0;

func_mod()
{


__________________

Last edited by Sanjay Singh; 01-10-2020 at 07:16.
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-10-2020 , 07:21   Re: detect plugin
Reply With Quote #2

For the 15th time, use the API.

https://www.amxmodx.org/api/amxmodx/is_plugin_loaded

The name of the function is pretty logical so you could have easily found it if you tried searching.
__________________

Last edited by OciXCrom; 01-10-2020 at 07:22.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Sanjay Singh
Veteran Member
Join Date: Sep 2016
Old 01-10-2020 , 07:51   Re: detect plugin
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
For the 15th time, use the API.

https://www.amxmodx.org/api/amxmodx/is_plugin_loaded

The name of the function is pretty logical so you could have easily found it if you tried searching.
I tried this but plugin shows bad load in amx_plugins
I used this command
PHP Code:
is_plugin_loaded("test.amxx",true
__________________
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-10-2020 , 08:05   Re: detect plugin
Reply With Quote #4

For the 120th time - show the full error.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Sanjay Singh
Veteran Member
Join Date: Sep 2016
Old 01-10-2020 , 08:14   Re: detect plugin
Reply With Quote #5

I am using api of xp plugin
PHP Code:
<xpapi
but xp plugin is not loaded it will load only on specific map so (maps folder plugins-de_dust2.ini)

but I compiled my plugin with that include <xpapi> and added in default plugins.ini

Error: amx_plugins
PHP Code:
unknown unknown Bad Load 
Shows error In normal maps but in map which load xp plugin is loaded will work fine for plugin.

why this plugin not working in normal maps.
__________________
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-10-2020 , 09:56   Re: detect plugin
Reply With Quote #6

Show the full code and the full error when the server starts.

I'm 99% sure that you get a "bad load" because you're using a function from a plugin that isn't loaded. Using "is_plugin_loaded" won't prevent such errors. You need to use a native filter to check if the natives are avaialble.

Check my Knife Models plugin to see how I included natives from my Rank System and use them if the plugin is loaded (lines 9-20, 764-780).
__________________

Last edited by OciXCrom; 01-10-2020 at 09:56.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 01-10-2020 , 12:23   Re: detect plugin
Reply With Quote #7

public plugin_init()
{
//some code
}
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
Reply


Thread Tools
Display Modes

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 02:55.


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