Promouvoir serveur

Initial release 1.0.0

Browse Source
1.0.0 — Initial release.
Daemon666 committed commit b5281f0d85976ce9d5d75fa30f14de155ba66080
4 changed files with 249 additions and 0 deletions
+3 -0 CHANGELOG.md A
@@ -0,0 +1,3 @@
1 +## 1.0.0 (2025-09-03)
2 +
3 +1.0.0 — Initial release.
+1 -0 README.md A
@@ -0,0 +1 @@
1 +<p>A <strong>deathrun game-mode core</strong>. Each round exactly one player is chosen — by a fair least-recently-used queue kept per map — to be the trap-controlling <em>Terrorist</em>. Everyone else is a Counter-Terrorist runner armed with a knife. The Terrorist gets extra health and a configurable weapon to punish campers, buying is blocked, and the round is won the normal way: kill the Terrorist, or let the Terrorist wipe the runners with the map's traps.</p><p>Independent GPL re-implementation inspired by <strong>Deathrun Manager</strong> by NiHiLaNTh.</p><h2>Features</h2><ul><li>Fair activator queue so the same player is not always the Terrorist.</li><li>Runners forced to knife only; Terrorist gets a configurable weapon and health.</li><li>Buy menu, buyammo and buyequip blocked; money zeroed.</li><li>HUD showing the current trap-master.</li></ul><h2>Installation</h2><ol><li>Put <code>csb_deathrun_manager.amxx</code> in <code>addons/amxmodx/plugins/</code>.</li><li>Add it to <code>plugins.ini</code>.</li><li>Run it on a <code>deathrun_</code> map; set <code>mp_freezetime 0</code>.</li><li>Change the map.</li></ol>
+198 -0 addons/amxmodx/scripting/csb_deathrun_manager.sma A
@@ -0,0 +1,198 @@
1 +/*
2 + * CSB Deathrun Manager
3 + * Copyright (C) 2026 counter-strike-boost.com
4 + *
5 + * A deathrun game-mode core. Each round one player is picked, by a fair
6 + * least-recently-used queue, to be the trap-controlling Terrorist; everyone
7 + * else is a Counter-Terrorist with a knife. The Terrorist gets a configurable
8 + * weapon to punish campers, buying is blocked and the round is won the normal
9 + * way (kill the Terrorist, or the Terrorist wipes the runners).
10 + *
11 + * Inspired by Deathrun Manager by NiHiLaNTh. Independent GPL re-implementation.
12 + *
13 + * This program is free software: you can redistribute it and/or modify it
14 + * under the terms of the GNU General Public License as published by the Free
15 + * Software Foundation, either version 3 of the License, or (at your option)
16 + * any later version. Distributed WITHOUT ANY WARRANTY. See the GNU General
17 + * Public License for more details: <https://www.gnu.org/licenses/>.
18 + */
19 +
20 +#include <amxmodx>
21 +#include <hamsandwich>
22 +#include <cstrike>
23 +#include <fun>
24 +
25 +new const PLUGIN[] = "CSB Deathrun Manager"
26 +new const VERSION[] = "1.0.0"
27 +new const AUTHOR[] = "counter-strike-boost.com"
28 +
29 +new g_pEnabled, g_pTerHealth, g_pTerWeapon
30 +new g_iPickCount[33] // times each slot has been the trap Terrorist this map
31 +new g_iActivator // current trap Terrorist, 0 if none
32 +new g_iMaxPlayers
33 +
34 +public plugin_init()
35 +{
36 + register_plugin(PLUGIN, VERSION, AUTHOR)
37 +
38 + g_pEnabled = register_cvar("csb_dr_enabled", "1")
39 + g_pTerHealth = register_cvar("csb_dr_ter_health", "150")
40 + g_pTerWeapon = register_cvar("csb_dr_ter_weapon", "weapon_deagle")
41 +
42 + RegisterHam(Ham_Spawn, "player", "fwPlayerSpawnPost", 1)
43 +
44 + // HLTV new-round event: fires once, right when the round actually starts.
45 + register_event("HLTV", "evNewRound", "a", "1=0", "2=0")
46 +
47 + // Kill the buy menu so the mode stays pure.
48 + register_clcmd("buy", "blockCmd")
49 + register_clcmd("buyammo", "blockCmd")
50 + register_clcmd("buyequip", "blockCmd")
51 + register_clcmd("say /dr", "cmdInfo")
52 +
53 + g_iMaxPlayers = get_maxplayers()
54 +
55 + set_task(1.0, "taskHud", _, _, _, "b")
56 +}
57 +
58 +public client_putinserver(id)
59 +{
60 + g_iPickCount[id] = 0
61 +}
62 +
63 +public client_disconnected(id)
64 +{
65 + if (g_iActivator == id)
66 + g_iActivator = 0
67 +}
68 +
69 +public blockCmd(id)
70 +{
71 + return PLUGIN_HANDLED
72 +}
73 +
74 +public evNewRound()
75 +{
76 + if (!get_pcvar_num(g_pEnabled))
77 + return
78 +
79 + assignRoles()
80 +}
81 +
82 +assignRoles()
83 +{
84 + new players[32], num
85 + get_players(players, num, "ch") // connected, on a team
86 +
87 + if (num < 2)
88 + {
89 + g_iActivator = 0
90 + return
91 + }
92 +
93 + // Fair pick: the connected player who has been Terrorist the fewest times.
94 + new best = -1, bestCount = 999999
95 + for (new i = 0; i < num; i++)
96 + {
97 + new id = players[i]
98 + if (g_iPickCount[id] < bestCount)
99 + {
100 + bestCount = g_iPickCount[id]
101 + best = id
102 + }
103 + }
104 +
105 + g_iActivator = best
106 + if (best != -1)
107 + g_iPickCount[best]++
108 +
109 + for (new i = 0; i < num; i++)
110 + {
111 + new id = players[i]
112 +
113 + if (id == g_iActivator)
114 + {
115 + if (cs_get_user_team(id) != CS_TEAM_T)
116 + cs_set_user_team(id, CS_TEAM_T)
117 + }
118 + else
119 + {
120 + if (cs_get_user_team(id) != CS_TEAM_CT)
121 + cs_set_user_team(id, CS_TEAM_CT)
122 + }
123 + }
124 +}
125 +
126 +public fwPlayerSpawnPost(id)
127 +{
128 + if (!get_pcvar_num(g_pEnabled) || !is_user_alive(id))
129 + return
130 +
131 + new CsTeams:team = cs_get_user_team(id)
132 +
133 + if (team == CS_TEAM_T && id == g_iActivator)
134 + {
135 + set_user_health(id, get_pcvar_num(g_pTerHealth))
136 +
137 + new weapon[32]
138 + get_pcvar_string(g_pTerWeapon, weapon, charsmax(weapon))
139 +
140 + give_item(id, weapon)
141 + refillWeapon(id, weapon)
142 + }
143 + else if (team == CS_TEAM_CT)
144 + {
145 + // Runners: knife only.
146 + strip_user_weapons(id)
147 + give_item(id, "weapon_knife")
148 + }
149 +
150 + cs_set_user_money(id, 0, 1)
151 +}
152 +
153 +refillWeapon(id, const weapon[])
154 +{
155 + // map the given entity name to a sensible backpack ammo amount
156 + new csw = weaponToCsw(weapon)
157 + if (csw > 0)
158 + cs_set_user_bpammo(id, csw, 200)
159 +}
160 +
161 +weaponToCsw(const weapon[])
162 +{
163 + if (equal(weapon, "weapon_deagle")) return CSW_DEAGLE
164 + if (equal(weapon, "weapon_ak47")) return CSW_AK47
165 + if (equal(weapon, "weapon_m4a1")) return CSW_M4A1
166 + if (equal(weapon, "weapon_awp")) return CSW_AWP
167 + if (equal(weapon, "weapon_m249")) return CSW_M249
168 + if (equal(weapon, "weapon_usp")) return CSW_USP
169 + if (equal(weapon, "weapon_hegrenade")) return CSW_HEGRENADE
170 + return 0
171 +}
172 +
173 +public cmdInfo(id)
174 +{
175 + client_print(id, print_chat, "[Deathrun] One trap-master Terrorist per round, picked by a fair queue. Runners get a knife. Buying is disabled.")
176 + return PLUGIN_HANDLED
177 +}
178 +
179 +public taskHud()
180 +{
181 + if (!get_pcvar_num(g_pEnabled))
182 + return
183 +
184 + new name[32]
185 + if (g_iActivator && is_user_connected(g_iActivator))
186 + get_user_name(g_iActivator, name, charsmax(name))
187 + else
188 + copy(name, charsmax(name), "waiting...")
189 +
190 + new players[32], num
191 + get_players(players, num, "c")
192 +
193 + for (new i = 0; i < num; i++)
194 + {
195 + set_hudmessage(255, 80, 80, 0.02, 0.15, 0, 0.0, 1.1, 0.0, 0.0, -1)
196 + show_hudmessage(players[i], "Deathrun Trap master: %s", name)
197 + }
198 +}
+47 -0 csb.json A
@@ -0,0 +1,47 @@
1 +{
2 + "name": "CSB Deathrun Manager",
3 + "category": "gameplay",
4 + "tags": "deathrun, terrorist, traps",
5 + "image": "",
6 + "original_author": "NiHiLaNTh (Deathrun Manager)",
7 + "original_url": "",
8 + "license": "GPL-3.0",
9 + "title": "CSB Deathrun Manager",
10 + "short_desc": "Deathrun core: a fairly-picked trap-master Terrorist vs knife-only runners, with buying disabled.",
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": "hamsandwich,cstrike,fun",
20 + "install_notes": "1. Put csb_deathrun_manager.amxx in addons/amxmodx/plugins/\n2. Add it to plugins.ini\n3. Use a deathrun_ map and mp_freezetime 0\n4. Change the map",
21 + "known_conflicts": "Other game-mode cores (GunGame, zombie, CSDM). Run one mode at a time.",
22 + "cvars": [
23 + {
24 + "name": "csb_dr_enabled",
25 + "default": "1",
26 + "description": "Master switch for the deathrun core."
27 + },
28 + {
29 + "name": "csb_dr_ter_health",
30 + "default": "150",
31 + "description": "Health of the trap-master Terrorist."
32 + },
33 + {
34 + "name": "csb_dr_ter_weapon",
35 + "default": "weapon_deagle",
36 + "description": "Weapon entity name given to the Terrorist."
37 + }
38 + ],
39 + "commands": [
40 + {
41 + "name": "say /dr",
42 + "access": "",
43 + "description": "Show a short deathrun rules message."
44 + }
45 + ],
46 + "main": "addons/amxmodx/scripting/csb_deathrun_manager.sma"
47 +}
0 48