Left 4 Dead Server MOTD Guide

Cекреты/Коды

Every time a player enters a Left 4 Dead server online, a message of the day screen welcomes them. There"s a default MOTD, but if you"re paying for your own server, you probably want to customize it. This guide will show you how.

First, we"ll look at the actual MOTD screen:

Left 4 Dead MOTD screen

There"s two sections that you are able to customize: the host banner on top and the message of the day which takes up the majority of the screen on the bottom. These two sections are actually just web pages (html files), which can be entered into the files on the server or hosted on your own web server/web host. The two files to control these sections are «host.txt» for the host banner, and «motd.txt» for the MOTD. You can find these in your server"s L4D directory at l4d/left4dead/. Note that this is NOT the same directory as the server.cfg file that you use to change server settings. The server.cfg file is located in l4d/left4dead/cfg/.

The default host banner and MOTD run off of Valve"s web servers. The default host.txt and motd.txt files contain only one line which is a URL to the website you wish to have displayed. You can either use this method if you have your own hosting or you can just fill the .txt file with HTML code. If you have multiple servers with the same banner, it"s best to use web hosting so you only have to change the banner in one place.

One very important thing to realize about the MOTD and host banner is that they change sizes depending on the resolution the player is running at. The following values are in pixels, you can click on the screen resolutions to see what the MOTD looks like on that resolution:

ScreenHost bannerMOTD
800×600335×66600×300
1024×768430×86766×382
1280×1024575×1151020×510
1680×1050400×80718×359
1920×1080605×1211076×538

The ratio of width to height for the host banner is 5:1, and the ratio of width to height is 2:1. You have two choices with the host banner: either make it one large size and have it be cropped for people on lower resolutions (which is what I believe Valve does), or you can use some CSS in your HTML code to automatically resize the banner no matter what resolution a player is using. This is the method we use, and it"s a simple little trick.

Our host.txt file has just one line:

http://www.left4dead411.com/server-host.html

The code to that webpage is as follows:

<html>
<head><title>Left 4 Dead 411</title></head>
<body style="margin:0px;padding:1px;background:#000000;">
<img src="http://i162.photobucket.com/albums/t280/left4dead411/l4d411-communityserverbanner.jpg" style="width:100%;height:100%;" />
</body>
</html>

That"s all it is! The title doesn"t show up anywhere, so it"s not important. The body styling is to make sure the image appears in the very top left, with one pixel of padding (L4D adds that white border to both sections), and a background color for when the image is loading. The image tag has a style of 100% width and height. If you go to that page in your browser, it"ll look really messed up. But since you know for a fact that every resolution has a 5:1 ratio for the host banner, it will always look fine and be in the same proportions. One little bug: on 1920×1080, when you first get into the game sometimes the banner is sized strangely (pic). Hopefully this gets fixed.

The MOTD section is the same as the host banner — it can be either a hosted HTML file (place the URL on a single line in the top of the .txt file) or you can just put the HTML code directly into the text file. All we have is a simple background image with some centered text, you can see it/view the source here if you need an example.

If your MOTD is not showing up, you might have to set motd_enable 1 in your server.cfg.

That"s all there is to it! Head to our forums if you need any help.

Cсылка на эту страницу: 
BBcode: 

Новости через RSS

Вы можете читать новости нашего сайта в формате RSS в любое время, нам не жалко.

Чтобы добавить новостной поток в свою любимую читалку, кликните по иконке:

Новости по почте

Свежие темы форума

Система Orphus