MOTD Removal: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "==Overview== This is a simple code removal to get rid of the MOTD (Message Of The Day) Panel showing every time you load a game. ==hl2mp_client.cpp== In the Server folder of the...")
 
m (updated language bar.)
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
==Overview==
{{lang|MOTD Removal}}
This is a simple code removal to get rid of the MOTD (Message Of The Day) Panel showing every time you load a game.
This is a simple code removal to stop the MOTD (Message Of The Day) Panel showing every time you load a map.


==hl2mp_client.cpp==
==<tt>hl2mp_client.cpp</tt>==
In the Server folder of the source look for and open '''hl2mp_client.cpp'''
In the Server folder of the source, look for and open <tt>hl2mp_client.cpp</tt>.


Search for '''const ConVar *hostname = cvar->FindVar( "hostname" );'''
Search for '''const ConVar *hostname = cvar->FindVar( "hostname" );''' at line 66 and comment out or delete the following code block:
and comment out or delete the following code block


<source lang="cpp">
<source lang="cpp">
const ConVar *hostname = cvar->FindVar( "hostname" );
const ConVar *hostname = cvar->FindVar( "hostname" );
const char *title = (hostname) ? hostname->GetString() : "MESSAGE OF THE DAY";
const char *title = (hostname) ? hostname->GetString() : "MESSAGE OF THE DAY";


KeyValues *data = new KeyValues("data");
KeyValues *data = new KeyValues("data");
data->SetString( "title", title ); // info panel title
data->SetString( "title", title ); // info panel title
data->SetString( "type", "1" ); // show userdata from stringtable entry
data->SetString( "type", "1" ); // show userdata from stringtable entry
data->SetString( "msg", "motd" ); // use this stringtable entry
data->SetString( "msg", "motd" ); // use this stringtable entry


pPlayer->ShowViewPortPanel( PANEL_INFO, true, data );
pPlayer->ShowViewPortPanel( PANEL_INFO, true, data );


data->deleteThis();
data->deleteThis();
</source>
</source>
The MOTD should now no longer appear every time you load a map
The MOTD should now no longer appear every time you load a map.
[[Category:Programming]] [[Category:VGUI]]
[[Category:Programming]] [[Category:VGUI]]

Latest revision as of 14:38, 2 September 2022

English (en)Deutsch (de)Русский (ru)Translate (Translate)

This is a simple code removal to stop the MOTD (Message Of The Day) Panel showing every time you load a map.

hl2mp_client.cpp

In the Server folder of the source, look for and open hl2mp_client.cpp.

Search for const ConVar *hostname = cvar->FindVar( "hostname" ); at line 66 and comment out or delete the following code block:

const ConVar *hostname = cvar->FindVar( "hostname" );
const char *title = (hostname) ? hostname->GetString() : "MESSAGE OF THE DAY";

KeyValues *data = new KeyValues("data");
data->SetString( "title", title );		// info panel title
data->SetString( "type", "1" );			// show userdata from stringtable entry
data->SetString( "msg",	"motd" );		// use this stringtable entry

pPlayer->ShowViewPortPanel( PANEL_INFO, true, data );

data->deleteThis();

The MOTD should now no longer appear every time you load a map.