Raised This Month: $51 Target: $400
 12% 

Loading / Unloading a plugin from another plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mecha the Slag
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 12-20-2010 , 14:02   Loading / Unloading a plugin from another plugin
Reply With Quote #1

Hi. I have a main plugin and several smaller plugins used with it.

At several points I need to unload and load a plugin. How is this done using a plugin? Thanks in advance!
__________________
Mecha the Slag is offline
psychonic

BAFFLED
Join Date: May 2008
Old 12-20-2010 , 14:18   Re: Loading / Unloading a plugin from another plugin
Reply With Quote #2

Quote:
Originally Posted by Mecha the Slag View Post
Hi. I have a main plugin and several smaller plugins used with it.

At several points I need to unload and load a plugin. How is this done using a plugin? Thanks in advance!
The right answer:
You shouldn't need to. Register a plugin library in the main plugin. In the smaller plugins, use a bool to keep track of whether or not the main one is loaded. You can check on start with LibraryExists and get notified of a change with OnLibraryAdded and OnLibraryRemoved. Don't call natives from it if it's not loaded.

The answer to your actual question:
GetPluginIterator + ReadPlugin + GetPluginFilename + ServerCommand w/ "sm plugins (un)load"
psychonic is offline
Mnkras
Senior Member
Join Date: Mar 2009
Location: 127.0.0.1
Old 12-20-2010 , 20:51   Re: Loading / Unloading a plugin from another plugin
Reply With Quote #3

there is a plugin that does it via the admin menu, http://forums.alliedmods.net/showthread.php?p=719212
__________________
Mnkras is offline
Reply



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 17:56.


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