AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Check game include depending on it. (https://forums.alliedmods.net/showthread.php?t=107019)

Exceed 10-21-2009 16:20

Check game include depending on it.
 
Can you depending on the game include for example <cstrike> only if the mod is cs and <DoDX> only if the mod is dod. cuz as you know the mod wont load if the <DoDX> in cs.

tpt 10-21-2009 16:38

Re: Check game include depending on it.
 
I think you can use this: get_modname ( name[], len ). :wink:

fysiks 10-21-2009 16:47

Re: Check game include depending on it.
 
To prevent the incorrect module from loading you probably need to use preprocessor directives. However, this would require a separate compile for each mod. But, the advantage, in my opinion, is that the majority of code is going to be independent of the mod so having it all in one file is good for when you update non-mod specific code.

Exceed 10-21-2009 18:23

Re: Check game include depending on it.
 
What i want to do is to check for the game, then if it is cstrike load <cstrike> and then i have some code in a csstrike.inl which is game specific. the main mod is to handle the basics and load the right .inl.

fysiks 10-21-2009 18:48

Re: Check game include depending on it.
 
What is a .inl?

I don't think it's possible. Use my suggestion.

Exceed 10-21-2009 20:10

Re: Check game include depending on it.
 
.inl is an inline file and i ame already using them for my mods. take a look at fx bf2 mod and see how he uses .inl files.

Hawk552 10-21-2009 21:01

Re: Check game include depending on it.
 
Check out module filters.

Exceed 10-22-2009 09:09

Re: Check game include depending on it.
 
So you can actually use some module functions without including the actual module? wierd but ok, i'll give it a try.

Hawk552 10-22-2009 10:38

Re: Check game include depending on it.
 
Quote:

Originally Posted by Exceed (Post 969147)
So you can actually use some module functions without including the actual module? wierd but ok, i'll give it a try.

No, you include all modules that you may need and then, as long as you filter them and don't run any of their natives, even if they're not there you can keep running the plugin.

Emp` 10-22-2009 12:45

Re: Check game include depending on it.
 
If you need an example, you can see it being used in this plugin: http://forums.alliedmods.net/showthread.php?t=57863


All times are GMT -4. The time now is 17:32.

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