Raised This Month: $ Target: $400
 0% 

Optional Include


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mlk27
Veteran Member
Join Date: May 2008
Old 05-26-2009 , 22:30   Optional Include
Reply With Quote #1

Is it possible to make optional #include? Load/unload the include depending on cvar..

I have some sub plugins that uses native from other plugin. Sometimes I may want to disable the plugin but doing so will cause all the sub plugins fail to run
Mlk27 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-26-2009 , 22:41   Re: Optional Include
Reply With Quote #2

You can not load includes at run-time because they are compiled into the plugin. The only way to conditionally 'load\unload' an include is with pre-compiler directives (which occurs when you compile the plugin).

Code:
#if defined OPTION #include <fakemeta> #endif
__________________
Bugsy is offline
Mlk27
Veteran Member
Join Date: May 2008
Old 05-27-2009 , 01:25   Re: Optional Include
Reply With Quote #3

Oh. hm that's not cool. Looks like Im gonna have to recompile all the plugins that use the native
Mlk27 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-27-2009 , 17:59   Re: Optional Include
Reply With Quote #4

Quote:
Originally Posted by Mlk27 View Post
Oh. hm that's not cool. Looks like Im gonna have to recompile all the plugins that use the native
It shouldn't have compiled in the first place if the native wasn't included . . . unless you changed it somehow I guess.
__________________
fysiks 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 01:35.


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