Raised This Month: $ Target: $400
 0% 

Check game include depending on it.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exceed
Member
Join Date: Oct 2004
Old 10-21-2009 , 16:20   Check game include depending on it.
Reply With Quote #1

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.
__________________
Exceed^ - I JUST CAN'T STOP.
Exceed is offline
tpt
Member
Join Date: Jun 2009
Location: Scripting help section
Old 10-21-2009 , 16:38   Re: Check game include depending on it.
Reply With Quote #2

I think you can use this: get_modname ( name[], len ).
tpt is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-21-2009 , 16:47   Re: Check game include depending on it.
Reply With Quote #3

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.
__________________
fysiks is offline
Exceed
Member
Join Date: Oct 2004
Old 10-21-2009 , 18:23   Re: Check game include depending on it.
Reply With Quote #4

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.
__________________
Exceed^ - I JUST CAN'T STOP.
Exceed is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-21-2009 , 18:48   Re: Check game include depending on it.
Reply With Quote #5

What is a .inl?

I don't think it's possible. Use my suggestion.
__________________
fysiks is offline
Exceed
Member
Join Date: Oct 2004
Old 10-21-2009 , 20:10   Re: Check game include depending on it.
Reply With Quote #6

.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.
__________________
Exceed^ - I JUST CAN'T STOP.
Exceed is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-21-2009 , 21:01   Re: Check game include depending on it.
Reply With Quote #7

Check out module filters.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Exceed
Member
Join Date: Oct 2004
Old 10-22-2009 , 09:09   Re: Check game include depending on it.
Reply With Quote #8

So you can actually use some module functions without including the actual module? wierd but ok, i'll give it a try.
__________________
Exceed^ - I JUST CAN'T STOP.
Exceed is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 10-22-2009 , 12:45   Re: Check game include depending on it.
Reply With Quote #9

If you need an example, you can see it being used in this plugin: http://forums.alliedmods.net/showthread.php?t=57863
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
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:32.


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