Raised This Month: $ Target: $400
 0% 

Loading / Unloading Plugins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
meng
Veteran Member
Join Date: Oct 2005
Location: us
Old 07-01-2009 , 01:45   Loading / Unloading Plugins
Reply With Quote #1

maybe somebody can help me here. is there anyway to have certain plugins unloaded/disabled by default. however, be able to use cfg files to load them? im trying to load simple custom content plugins ONLY for certain maps. i have the map-cfgs plugin working perfectly. i looked into using plugin_settings config file but im not sure it provides this functionality. if i "blockload" a plugin. can i call for it to load with cfg files?
meng is offline
Send a message via Yahoo to meng
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 07-01-2009 , 10:38   Re: Loading / Unloading Plugins
Reply With Quote #2

Put the plugins into the disabled directory and then sm plugins load/unload them in your configs.
Fyren is offline
meng
Veteran Member
Join Date: Oct 2005
Location: us
Old 07-01-2009 , 14:58   Re: Loading / Unloading Plugins
Reply With Quote #3

maybe im doing something wrong but.. as you say, i put them in the disabled dir. but *sm plugins load my_plugin.smx* doesnt do the trick. ive tried both in the map cfg and by server console and all it does is provide a list of the plugins that are enabled? if i were to get this to work, would i have to unload the plugin with another cfg entry? i need them to be disabled by default. but enabled when the map-cfg calls for it. possible? thx for helping!

Last edited by meng; 07-01-2009 at 15:01.
meng is offline
Send a message via Yahoo to meng
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 07-02-2009 , 05:36   Re: Loading / Unloading Plugins
Reply With Quote #4

Try
Quote:
sm plugins load "disabled/my_plugin"
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
meng
Veteran Member
Join Date: Oct 2005
Location: us
Old 07-02-2009 , 14:40   Re: Loading / Unloading Plugins
Reply With Quote #5

thx! that worked! but now i have the problem i thought i might run into. the plugins stay loaded despite map changes. is there something i can do to prevent this? perhaps in plugin_settings? im more or less clueless as to what plugin_settings can do. just a thought.
meng is offline
Send a message via Yahoo to meng
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 07-02-2009 , 21:26   Re: Loading / Unloading Plugins
Reply With Quote #6

Loading and unloading plugins to turn them on/off isn't really a good way to do it in the first place, but if you can't code and the plugins don't have cvars for controlling their behaviour, you don't have a choice. You'd have to handle all loading and unloading in your configs. You can unload_all and refresh to reload all the ones not in disabled.
Fyren is offline
meng
Veteran Member
Join Date: Oct 2005
Location: us
Old 07-03-2009 , 17:25   Re: Loading / Unloading Plugins
Reply With Quote #7

i must have seen an old plugin_settings config. because i swear i saw an option to have the plugins lifetime set to just 1 map. but in mine there is only an option to reload everymap. i guess ill have to try and code the plugins to give me more control. could somebody tell me what loading a plugin paused or blockloading is all about. maybe i could use one of these functions to control the plugins? just curious, thx for your help! i can merely edit simple plugins, i cannot write my own. but if its my only option ill try and edit them with proper enable cvars.
meng is offline
Send a message via Yahoo to meng
82694
SourceMod Donor
Join Date: Apr 2007
Old 07-04-2009 , 01:14   Re: Loading / Unloading Plugins
Reply With Quote #8

I believe you could create a cfg/mapname.cfg. Basically model it like the cfg/sourcemod/sm_warmode_on.cfg .
Quote:
//This file unloads all plugins, re-loads a few "safe" ones, and then prevents
//any more plugins from being loaded.
sm plugins unload_all
sm plugins load basebans.smx
sm plugins load basecommands.smx
sm plugins load admin-flatfile.smx
sm plugins load adminhelp.smx
sm plugins load adminmenu.smx
sm plugins load_lock
Replace the above plugins with what ever you want to load and leave out the ones you don't want loaded.

Then you could put these lines from the cfg/sourcemod/sm_warmode_off.cfg in your server.cfg to put back to normal.

Quote:
//This file re-enables a server from "war mode" by unlocking plugin loading
//and refreshing the plugins list.
sm plugins load_unlock
sm plugins refresh
__________________
82694 is offline
Send a message via Yahoo to 82694 Send a message via Skype™ to 82694
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 02:55.


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