[ H3LP ] Check Running Mod
Hello. is there any way to check if the mod is HL or TFC before plugin-init where the global vars and other stuff are defined? I want to set some of the default models depending on the mod, valve or tfc. So for example if the game is hl, var[] = "a model" , for tfc var[] = "another model". Thanks !
|
Re: [ H3LP ] Check Running Mod
PHP Code:
|
Re: [ H3LP ] Check Running Mod
Quote:
|
Re: [ H3LP ] Check Running Mod
AFAIK plugin_natives is the first called function but I'm not sure what #if and #endif have to do with this because they're used by the compiler. If you mean that when the code inside #if and #endif is called I'm not really sure.
|
Re: [ H3LP ] Check Running Mod
No, #if, #endif and similar (preprocessor directives) are evaluated at compile-time. The compiler can't know on which game you'll be running your plugin.
You can let the user compiling your code to choose it by having them define what game it is (like #define GAME_TFC or #define GAME_VALVE) but that's as far as you can get, you'll have to resort to runtime checks, like what Edon has shown. |
| All times are GMT -4. The time now is 22:50. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.