Skip to content
View in the app

A better way to browse. Learn more.

Learn more

timeleft-in-hostname/README.txt

README.txt
54 lines · 2.4 KB · Text
Raw
Timeleft In Hostname 1.0.0 (olds.ro)
====================================

Adds the time left on the map to the server name, so the server browser and
the server list show it before anyone joins, for example:

    My Server | 15 min
    My Server | 45 sec        (last minute)

The plain server name is read from the hostname cvar when the map starts.
If an admin or another plugin changes hostname later, that new name becomes
the plain name and the time is added to it again. When the map ends, and
while mp_timelimit is 0, the plain name is put back without any time part,
so the server never shows "0 min".

Requirements
  - AMX Mod X 1.10 (no extra modules, no ReAPI)
  - Tested on AMX Mod X 1.10.0.5490, ReHLDS 3.15.0.896, ReGameDLL_CS 5.30.0.814

Install
  1. Compile scripting/olds_timeleft_name.sma with amxxpc 1.10 and copy
     olds_timeleft_name.amxx to addons/amxmodx/plugins/.
  2. Copy configs/plugins/olds_timeleft_name.cfg to addons/amxmodx/configs/plugins/
     (if you skip this, the plugin writes the same file with the defaults on
     its first start).
  3. Add olds_timeleft_name.amxx to addons/amxmodx/configs/plugins.ini.

How it works
  - The name is updated every olds_tlhn_interval seconds, and at once when
    hostname, mp_timelimit or one of the plugin's cvars changes.
  - Minutes are rounded up: with 14:30 left the name says 15 min.
  - In the last minute (olds_tlhn_lastmin 1) the name changes every 5 seconds
    and uses olds_tlhn_fmt_last.
  - A server name holds at most 63 bytes. If the result is longer, the plain
    name is shortened first so the time stays visible, and the cut never
    splits a UTF-8 character (names with diacritics stay readable).

Settings (addons/amxmodx/configs/plugins/olds_timeleft_name.cfg)
  olds_tlhn_interval 30                       seconds between updates (5 - 300)
  olds_tlhn_fmt      "%base% | %left% min"    name while more than a minute is left
  olds_tlhn_lastmin  1                        1 = faster updates and the format below
                                              in the last minute
  olds_tlhn_fmt_last "%base% | %secs% sec"    name in the last minute
  Placeholders: %base% plain server name, %left% minutes left, %secs% seconds left.

Commands
  None.

No sounds, models, sprites or language files are needed: the plugin shows
no text to players, only the server name.

Credits and licence
  Written from scratch by alexit (olds.ro workshop) for workshop card LIB-1996.
  Licence: GPL-3.0-or-later.

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.