AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   if(plugin is loaded) help. (https://forums.alliedmods.net/showthread.php?t=76187)

EvolDay 08-19-2008 21:55

if(plugin is loaded) help.
 
if(plugin.amxx == loaded){
blah blah
}

is there a way to check if i plugin is loaded. like how would the code look like i know what i made doesnt mean anything but i just made it up so maybe you can understand what i am asking. Thank you to whoever can help.

Exolent[jNr] 08-19-2008 22:17

Re: if(plugin is loaded) help.
 
http://www.amxmodx.org/funcwiki.php?go=func&id=627

EvolDay 08-20-2008 01:34

Re: if(plugin is loaded) help.
 
Thank you :)

fxfighter 08-20-2008 02:50

Re: if(plugin is loaded) help.
 
Dosent find_plugin_byfile just return if it exsist in your plugins folder.
Think he wants to use is_plugin_loaded

ConnorMcLeod 08-20-2008 12:07

Re: if(plugin is loaded) help.
 
Quote:

Originally Posted by fxfighter (Post 672496)
Dosent find_plugin_byfile just return if it exsist in your plugins folder.

I don't think so since this native returns the plugin id (and INVALID_PLUGIN_ID = -1 if not founded).
I still prefer using is_plugin_loaded ;)

fxfighter 08-20-2008 12:23

Re: if(plugin is loaded) help.
 
But if you get badload then find_plugin_byfile will still show the plugin id right?
Because it dose exsist if not then the nativs name is a bit misleading.

danielkza 08-20-2008 12:38

Re: if(plugin is loaded) help.
 
Quote:

Originally Posted by fxfighter (Post 672676)
But if you get badload then find_plugin_byfile will still show the plugin id right?
Because it dose exsist if not then the nativs name is a bit misleading.

As far as I know,a bad load will return an invalid plugin id. Think like this, if the file doesn't exist, how could the plugin be loaded? The amxx list is just a reference,it is not a copy of what exists in memory.

fxfighter 08-20-2008 13:09

Re: if(plugin is loaded) help.
 
But if the file dose exsist and the user just wrote the wrong name in plugins.ini
It will not return what its suppose to do if the thingy you mentioned danielkza is correct about find_plugin_byfile.

So the only diffrence betwin the nativs is what they compare?(filename or the one in register_plugin)
Or dose it return correct if it dont get loaded?
If not the name is really misleading and file_exists is a better option.


All times are GMT -4. The time now is 03:14.

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