Raised This Month: $32 Target: $400
 8% 

Detect game


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 02-10-2015 , 14:12   Detect game
Reply With Quote #1

Is there a way to detect which game the server is running with getting the game description?

Is GetGameFolderName(char[] buffer, int maxlength) will work if the -game directoy have been change in the command line?
Mathias. is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-10-2015 , 14:17   Re: Detect game
Reply With Quote #2

GetEngineVersion.

However, games that share the same engine (mainly third-party games on Source SDK 2006, Source SDK 2007, or Source SDK 2013) will still need to be detected some other way.

Edit: Forgot to mention, here are the valid values GetEngineVersion will return in SM 1.7.0:

Code:
enum EngineVersion
{
	Engine_Unknown,				/**< Could not determine the engine version */
	Engine_Original,				/**< Original Source Engine (used by The Ship) */
	Engine_SourceSDK2006,		/**< Episode 1 Source Engine (second major SDK) */
	Engine_SourceSDK2007,		/**< Orange Box Source Engine (third major SDK) */
	Engine_Left4Dead,			/**< Left 4 Dead */
	Engine_DarkMessiah,			/**< Dark Messiah Multiplayer (based on original engine) */
	Engine_Left4Dead2 = 7,		/**< Left 4 Dead 2 */
	Engine_AlienSwarm,			/**< Alien Swarm (and Alien Swarm SDK) */
	Engine_BloodyGoodTime,		/**< Bloody Good Time */
	Engine_EYE,					/**< E.Y.E Divine Cybermancy */
	Engine_Portal2,				/**< Portal 2 */
	Engine_CSGO,				/**< Counter-Strike: Global Offensive */
	Engine_CSS,					/**< Counter-Strike: Source */
	Engine_DOTA,				/**< Dota 2 */
	Engine_HL2DM,				/**< Half-Life 2 Deathmatch */
	Engine_DODS,				/**< Day of Defeat: Source */
	Engine_TF2,					/**< Team Fortress 2 */
	Engine_NuclearDawn,			/**< Nuclear Dawn */
	Engine_SDK2013,				/**< Source SDK 2013 */
	Engine_Blade,				/**< Blade Symphony */
	Engine_Insurgency,			/**< Insurgency (2013 Retail version)*/
	Engine_Contagion,			/**< Contagion */
};
As I recall, the reason there's a gap just before Engine_Left4Dead2 is because Source 2009 had a listing before it was broken out into separate engines for HL2:DM, DoD:S, CS:S, and TF2.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 02-10-2015 at 14:25.
Powerlord is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 02-10-2015 , 14:18   Re: Detect game
Reply With Quote #3

funcommands.sp handles both ways.
Mitchell is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 02-10-2015 , 14:27   Re: Detect game
Reply With Quote #4

thanks allot that exacly what I was looking for <3
Mathias. 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 19:37.


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