Sunucu tanitimi

Initial release 1.0.0

Browse Source
1.0.0 - Initial release.
Daemon666 committed commit f0374c79fe211e2188ebdbaf457d45ebed2c39fb
4 changed files with 156 additions and 0 deletions
+3 -0 CHANGELOG.md A
@@ -0,0 +1,3 @@
1 +## 1.0.0 (2026-05-24)
2 +
3 +1.0.0 - Initial release.
+1 -0 README.md A
@@ -0,0 +1 @@
1 +<p><strong>CSB Nextmap Info</strong> keeps the upcoming map visible. It reads <code>amx_nextmap</code> live (so it reflects a map vote result), shows it in a small HUD line, answers <code>/nextmap</code> in chat with the time left, and announces the next map at fixed thresholds &mdash; 5, 2, 1 minute and 30 seconds &mdash; so nobody is caught out by the change.</p><h2>Features</h2><ul><li>HUD line with the next map, refreshed live from <code>amx_nextmap</code>.</li><li><code>/nextmap</code> chat command with time left.</li><li>Threshold announcements near map end (once each).</li><li>Pure core plugin, no extra modules.</li></ul><h2>Installation</h2><ol><li>Compile <code>csb_nextmap_hud.sma</code>, copy it to <code>addons/amxmodx/plugins/</code> and add it to <code>plugins.ini</code>.</li><li>Make sure a nextmap/mapchooser plugin sets <code>amx_nextmap</code> (the stock <code>nextmap.amxx</code> does).</li><li>Change the map.</li></ol>
+110 -0 addons/amxmodx/scripting/csb_nextmap_hud.sma A
@@ -0,0 +1,110 @@
1 +/*
2 + * CSB Nextmap Info
3 + * Copyright (C) 2026 counter-strike-boost.com
4 + *
5 + * Shows the next map in a small HUD line and answers /nextmap in chat, reading
6 + * the value from amx_nextmap. As the map winds down it announces the next map at
7 + * fixed time thresholds so nobody is surprised by the change, and it re-reads
8 + * amx_nextmap live in case a map vote replaced it.
9 + *
10 + * This program is free software: you can redistribute it and/or modify it under
11 + * the terms of the GNU General Public License as published by the Free Software
12 + * Foundation, either version 3 of the License, or (at your option) any later
13 + * version. It is distributed in the hope that it will be useful, but WITHOUT
14 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 + * FOR A PARTICULAR PURPOSE. See <https://www.gnu.org/licenses/> for details.
16 + */
17 +
18 +#include <amxmodx>
19 +
20 +new const PLUGIN[] = "CSB Nextmap Info"
21 +new const VERSION[] = "1.0.0"
22 +new const AUTHOR[] = "counter-strike-boost.com"
23 +
24 +new g_pEnabled, g_pHud
25 +new g_pNextmap
26 +new g_iSync
27 +
28 +/* announce thresholds in seconds of time left */
29 +new const g_iThresholds[] = { 300, 120, 60, 30 }
30 +new bool:g_bAnnounced[sizeof(g_iThresholds)]
31 +
32 +public plugin_init()
33 +{
34 + register_plugin(PLUGIN, VERSION, AUTHOR)
35 +
36 + g_pEnabled = register_cvar("csb_nextmap_enabled", "1")
37 + g_pHud = register_cvar("csb_nextmap_hud", "1")
38 +
39 + g_pNextmap = get_cvar_pointer("amx_nextmap")
40 +
41 + register_clcmd("say /nextmap", "cmdNextmap")
42 + register_clcmd("say_team /nextmap", "cmdNextmap")
43 + register_clcmd("say nextmap", "cmdNextmap")
44 +
45 + g_iSync = CreateHudSyncObj()
46 +
47 + set_task(2.0, "taskCheck", 44, _, _, "b")
48 +}
49 +
50 +getNextmap(out[], len)
51 +{
52 + if (g_pNextmap != 0)
53 + {
54 + get_pcvar_string(g_pNextmap, out, len)
55 + }
56 + else
57 + {
58 + get_cvar_string("amx_nextmap", out, len)
59 + }
60 +
61 + if (!out[0])
62 + copy(out, len, "unknown")
63 +}
64 +
65 +public cmdNextmap(id)
66 +{
67 + new nm[40]
68 + getNextmap(nm, charsmax(nm))
69 +
70 + new tl = get_timeleft()
71 +
72 + if (tl > 0)
73 + client_print(id, print_chat, "[CSB] Next map: %s (%d:%02d left)", nm, tl / 60, tl % 60)
74 + else
75 + client_print(id, print_chat, "[CSB] Next map: %s", nm)
76 +
77 + return PLUGIN_HANDLED
78 +}
79 +
80 +public taskCheck()
81 +{
82 + if (!get_pcvar_num(g_pEnabled))
83 + return
84 +
85 + new tl = get_timeleft()
86 +
87 + if (get_pcvar_num(g_pHud) && tl > 0)
88 + {
89 + new nm[40]
90 + getNextmap(nm, charsmax(nm))
91 +
92 + set_hudmessage(200, 200, 255, 0.75, 0.92, 0, 0.0, 2.0, 0.0, 0.0, -1)
93 + ShowSyncHudMsg(0, g_iSync, "Next: %s", nm)
94 + }
95 +
96 + /* announce at each threshold once */
97 + for (new i = 0; i < sizeof(g_iThresholds); i++)
98 + {
99 + if (!g_bAnnounced[i] && tl > 0 && tl <= g_iThresholds[i])
100 + {
101 + g_bAnnounced[i] = true
102 +
103 + new nm[40]
104 + getNextmap(nm, charsmax(nm))
105 +
106 + client_print(0, print_chat, "[CSB] %d minute(s) left - next map is %s.",
107 + g_iThresholds[i] / 60 >= 1 ? g_iThresholds[i] / 60 : 1, nm)
108 + }
109 + }
110 +}
+42 -0 csb.json A
@@ -0,0 +1,42 @@
1 +{
2 + "name": "CSB Nextmap Info",
3 + "category": "hud-info",
4 + "tags": "nextmap, map, info",
5 + "image": "",
6 + "original_author": "",
7 + "original_url": "",
8 + "license": "GPL-3.0",
9 + "title": "CSB Nextmap Info",
10 + "short_desc": "Shows the next map in a HUD line and answers /nextmap, announcing the upcoming map at fixed thresholds near map end.",
11 + "version": "1.0.0",
12 + "amxx_min": "1.9",
13 + "amxx_compile_default": "1.9",
14 + "rehlds_ok": true,
15 + "hlds_ok": true,
16 + "regamedll_required": false,
17 + "metamod_flavor": "any",
18 + "reapi_required": false,
19 + "modules": "",
20 + "install_notes": "1. Put csb_nextmap_hud.amxx in addons/amxmodx/plugins/ and add it to plugins.ini\n2. Ensure amx_nextmap is set by your map-cycle plugin\n3. Change map",
21 + "known_conflicts": "Relies on amx_nextmap being set; without a nextmap plugin it will show 'unknown'.",
22 + "cvars": [
23 + {
24 + "name": "csb_nextmap_enabled",
25 + "default": "1",
26 + "description": "Enable or disable nextmap info."
27 + },
28 + {
29 + "name": "csb_nextmap_hud",
30 + "default": "1",
31 + "description": "Show the next map as a HUD line."
32 + }
33 + ],
34 + "commands": [
35 + {
36 + "name": "say /nextmap",
37 + "access": "",
38 + "description": "Show the next map and time left."
39 + }
40 + ],
41 + "main": "addons/amxmodx/scripting/csb_nextmap_hud.sma"
42 +}
0 43