View Single Post
psychonic

BAFFLED
Join Date: May 2008
Old 01-07-2011 , 14:25   Re: Dynamic MOTD
Reply With Quote #10

Quote:
Originally Posted by Thraka View Post
Very awesome!

This little snippet will add the l4d game mode as a parameter. Just insert it into the DoReplacements method

Code:
	new Handle:cvarHGameMode = FindConVar("mp_gamemode");
	if (cvarHGameMode != INVALID_HANDLE)
	{
		decl String:gameMode[16];
		GetConVarString(cvarHGameMode, gameMode, sizeof(gameMode));
		ReplaceString(motdtitle, sizeof(motdtitle), "{L4D_GAMEMODE}", gameMode);
		ReplaceString(motdurl, sizeof(motdurl), "{L4D_GAMEMODE}", gameMode);
	}
Now you can easily determine for your web page if the game is versus, coop, etc..
Is this for L4D, L4D2, or both? I know that (at least at one point) setting game mode was different for each, but can mp_gamemode be read to get it on both?
psychonic is offline