AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Disable an entire plugin (https://forums.alliedmods.net/showthread.php?t=192222)

n0br41ner 08-07-2012 18:24

Disable an entire plugin
 
I would like to make a cvar g_cvarEnable for example that i can disable the entire plugin with it (or enable). Any help please?

Tried to look inside GunGame and CSDM but found that's is too complicated.

n0br41ner 08-23-2012 19:04

Re: Disable an entire plugin
 
bump!

Erox902 08-23-2012 19:36

Re: Disable an entire plugin
 
You could check the cvar on every round and save it to a bool then in each function of your plugin return PLUGIN_HANDLED if it's turned off

fysiks 08-23-2012 19:57

Re: Disable an entire plugin
 
Quote:

Originally Posted by n0br41ner (Post 1766638)
I would like to make a cvar g_cvarEnable for example that i can disable the entire plugin with it (or enable). Any help please?

Tried to look inside GunGame and CSDM but found that's is too complicated.

It's actually extremely easy conceptually. Just check the cvar before anything happens.

Quote:

Originally Posted by Erox902 (Post 1780783)
You could check the cvar on every round and save it to a bool then in each function of your plugin return PLUGIN_HANDLED if it's turned off

This is a very poor "blanket" answer and would not be a good idea to implement (the "check in every function" part, not the cache it on new round)

n0br41ner 08-23-2012 22:11

Re: Disable an entire plugin
 
Thank you. Got the concept.


All times are GMT -4. The time now is 05:49.

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