View Single Post
Thraka
AlliedModders Donor
Join Date: Aug 2005
Old 01-07-2011 , 14:20   Re: Dynamic MOTD
Reply With Quote #9

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..
Thraka is offline