--- title: "motd.txt: Writing an HTML MOTD That Actually Renders" excerpt: "How the CS 1.6 MOTD window loads motd.txt, the size limit that truncates it, the URL mode, and how to write HTML that renders in the in-game browser." category: "administration" tags: "motd, html" image: "" read_time: "7 min read" ---
The message-of-the-day box that pops up when a player connects is rendered by motd.txt in your cstrike/ folder, shown in the game client's embedded HTML control. It is one of the few places you can put branding and rules in front of every visitor, and it is also one of the easiest to get subtly wrong — because the renderer is not a modern browser, and the file has a hard size limit that silently truncates anything too large.
The file is cstrike/motd.txt, and the engine finds it through the motdfile cvar (default motd.txt). You can host multiple and switch:
// server.cfg motdfile "motd.txt"
The window opens automatically on connect and can be re-opened by the client bind motd. Plugins frequently override it (a custom rules menu, a store panel), so if your file is ignored, check whether an AMXX plugin is calling show_motd with its own content.
The MOTD is delivered over the game channel and the classic engine truncates it at roughly 1500 bytes. Go over and the tail of your page simply never arrives, which looks like broken HTML — an unclosed table, a cut-off paragraph. Two rules follow:
If motd.txt contains nothing but a single URL, the client treats it as an address and loads that page in the MOTD window instead of rendering the file as HTML:
https://your-domain.example/motd.html
This sidesteps the size limit entirely and lets you use a normal, cacheable web page. The trade-off: the client must be able to reach that URL, so it must be public HTTP(S) and reasonably fast, or the window hangs on connect. Do not point it at something that can go down — a broken MOTD URL greets every player with a blank or error box.
The in-game HTML control supports a small, old subset of HTML. Treat it like a very old browser:
<body>, <table>, <font>, <b>, <br>, <a>, <img>. Do not rely on external CSS files or JavaScript.https:// URL — the client fetches them over the network, they do not come from your game files.<body bgcolor="#111111" text="#dddddd">
<table width="100%">
<tr><td align="center">
<font size="5" color="#66ccff"><b>My CS 1.6 Server</b></font><br>
<font size="2">No cheating. No spawn-camping the hostages. Have fun.</font>
</td></tr>
</table>
</body>
Keep links to a couple; the window is small and players close it fast.
Save the file as plain ASCII/UTF-8 without a byte-order mark. A BOM or exotic encoding can make the first line render as garbage or push you over the byte limit unexpectedly. Windows editors that add a .txt a second time (so you end up with motd.txt.txt) are a recurring cause of "my MOTD does not show" — turn on file-extension display, the same trap that breaks server.cfg execution.
http:// to a host that is down. Use absolute https:// URLs to a reliable host.show_motd, or motdfile points somewhere else. Check the cvar and your plugin list.Connect from a real client — the MOTD window must open on join and render top to bottom with nothing truncated. Check the byte size on disk (wc -c cstrike/motd.txt); if it is near or over 1500, assume truncation and move to URL mode. If you edited it live, a reconnect is enough to reload it; no map change is required. To surface rules again during play, pair it with an adverts plugin that prints a short reminder in chat.