Dynamic Hostname 1.0.0 (olds.ro)
================================
Changes the server name (hostname) every few seconds, so the server list
shows a name that moves: either the time left on the map, or a series of
texts read from a file.
Mode 1: olds.ro CS | 12:34 left
Mode 2: olds.ro CS | Public 1.6 -> olds.ro CS | www.olds.ro -> ...
Requirements
- AMX Mod X 1.10 or newer (no extra modules, ReAPI is not needed)
- Written for AMX Mod X 1.10.0.5490, ReHLDS 3.15.0.896, ReGameDLL_CS 5.30.0.814
Install
1. Compile scripting/olds_hostname.sma with amxxpc 1.10 and copy
olds_hostname.amxx to addons/amxmodx/plugins/.
2. Copy data/lang/olds_hostname.txt to addons/amxmodx/data/lang/.
3. Copy configs/olds_hostname.txt (the frames for mode 2) and
configs/plugins/olds_hostname.cfg to the same folders under
addons/amxmodx/configs/ (if you skip the .cfg, the plugin writes it
with the defaults on its first start).
4. Add olds_hostname.amxx to addons/amxmodx/configs/plugins.ini.
Modes (olds_hn_mode)
0 Off: the plugin leaves the hostname alone.
1 The base name and the time left on the map, as mm:ss. Without a time
limit (mp_timelimit 0) the base name is shown alone.
2 The lines of configs/olds_hostname.txt, one after another, in the order
of the file, starting again at the first after the last.
Frames file (addons/amxmodx/configs/olds_hostname.txt)
- One server name per line, up to 32 lines.
- At most 63 bytes per line (the server list shows no more); longer lines
are cut, never inside a letter.
- Empty lines and lines starting with ; or // are skipped.
- Read at every map start; olds_hn_reload reads it again at once.
- Without frames, mode 2 shows the base name and the log says so once.
Server commands
olds_hn_status prints the settings, the frames and the hostname now
olds_hn_reload reads configs/olds_hostname.txt again
Notes
- The time left is worked out at every update from the current
mp_timelimit, so after a map change it is the new map's time.
- The hostname is set only when the text changed.
- Before a map change the plain base name is set back, so the list shows
no stale time. A hostname line in server.cfg is replaced by the plugin's
name as soon as the map has started.
- An empty olds_hn_base means "olds.ro CS"; the log says so once per map.
Settings (addons/amxmodx/configs/plugins/olds_hostname.cfg)
olds_hn_base "olds.ro CS" server name (mode 1 adds the time left)
olds_hn_mode 1 0 = off, 1 = time left, 2 = frames
olds_hn_interval 5 seconds between updates (1 - 300)
The "left" text is in data/lang/olds_hostname.txt (English); the server's
language (amx_language) is used. No sounds, models or sprites are used.
Credits and licence
Written from scratch by alexit (olds.ro workshop) for workshop card LIB-1570.
Licence: GNU GPL version 3 or later (GPL-3.0-or-later).