Продвинуть сервер
Black Friday До конца Скидка 50% на место в Master Server и на список Client, к которому прилагается ПОЖИЗНЕННЫЙ PREMIUM
02 Дн 21 Ч 47 Мин 25 Сек
Смотреть предложения

Initial release 1.0.0

Browse Source
1.0.0 - Initial release.
Daemon666 committed commit 476fcd91d69688d2ffbc10635043c9e412413b2d
4 changed files with 266 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><strong>CSB Match Warmup</strong> gives a clean pre-match phase. While warmup is active every player respawns one second after death, spawns with full money and armour and a free weapon set (rifle by team, deagle and nades), so people can aim-warm instead of standing around. The warmup ends when every connected player has typed <code>/ready</code>, or immediately when an admin runs <code>amx_match</code>. On end it restores the saved <code>mp_startmoney</code> and restarts the round so the match goes live from a clean state.</p><h2>Features</h2><ul><li>Instant respawn, full money, armour and free weapons during warmup.</li><li><code>say /ready</code> / <code>say /notready</code> with a live ready counter in the HUD.</li><li>Auto-goes-live when everyone is ready; <code>amx_match</code> forces it.</li><li>Saves and restores <code>mp_startmoney</code> so the live game is unaffected.</li></ul><h2>Installation</h2><ol><li>Enable the <code>cstrike</code>, <code>fun</code> and <code>hamsandwich</code> modules in <code>modules.ini</code>.</li><li>Compile <code>csb_warmup_manager.sma</code>, copy it to <code>addons/amxmodx/plugins/</code> and add it to <code>plugins.ini</code>.</li><li>Change the map.</li></ol>
+210 -0 addons/amxmodx/scripting/csb_warmup_manager.sma A
@@ -0,0 +1,210 @@
1 +/*
2 + * CSB Match Warmup
3 + * Copyright (C) 2026 counter-strike-boost.com
4 + *
5 + * A pre-match warmup: while it is active every player respawns instantly on
6 + * death, gets full money, armour and a free weapon set. The warmup ends when
7 + * everyone has typed /ready or an admin runs amx_match; the plugin then restores
8 + * the saved match money cvar and restarts the round so the game goes live clean.
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 +#include <amxmisc>
20 +#include <cstrike>
21 +#include <fun>
22 +#include <hamsandwich>
23 +
24 +new const PLUGIN[] = "CSB Match Warmup"
25 +new const VERSION[] = "1.0.0"
26 +new const AUTHOR[] = "counter-strike-boost.com"
27 +
28 +new g_pEnabled, g_pMoney
29 +new bool:g_bWarmup
30 +new bool:g_bReady[33]
31 +new g_iSavedMoney
32 +new g_iSync
33 +
34 +public plugin_init()
35 +{
36 + register_plugin(PLUGIN, VERSION, AUTHOR)
37 +
38 + g_pEnabled = register_cvar("csb_wu_enabled", "1")
39 + g_pMoney = register_cvar("csb_wu_money", "16000")
40 +
41 + RegisterHam(Ham_Spawn, "player", "fwSpawnPost", 1)
42 + register_event("DeathMsg", "eventDeath", "a", "1>0")
43 +
44 + register_clcmd("say /ready", "cmdReady")
45 + register_clcmd("say_team /ready", "cmdReady")
46 + register_clcmd("say /notready", "cmdNotReady")
47 +
48 + register_concmd("amx_match", "cmdMatch", ADMIN_LEVEL_A, "- force the warmup to end and go live")
49 +
50 + g_iSync = CreateHudSyncObj()
51 + set_task(1.0, "taskHud", 0, _, _, "b")
52 +}
53 +
54 +public plugin_cfg()
55 +{
56 + g_iSavedMoney = get_cvar_num("mp_startmoney")
57 +
58 + if (get_pcvar_num(g_pEnabled))
59 + startWarmup()
60 +}
61 +
62 +startWarmup()
63 +{
64 + g_bWarmup = true
65 +
66 + for (new i = 1; i <= 32; i++)
67 + g_bReady[i] = false
68 +
69 + client_print(0, print_chat, "[CSB] WARMUP started. Type /ready when you are set.")
70 +}
71 +
72 +public client_putinserver(id)
73 +{
74 + g_bReady[id] = false
75 +}
76 +
77 +public fwSpawnPost(id)
78 +{
79 + if (!g_bWarmup || !is_user_alive(id))
80 + return
81 +
82 + new team = cs_get_user_team(id)
83 +
84 + if (team != CS_TEAM_T && team != CS_TEAM_CT)
85 + return
86 +
87 + cs_set_user_money(id, get_pcvar_num(g_pMoney))
88 + set_user_armor(id, 100)
89 +
90 + give_item(id, "weapon_hegrenade")
91 + give_item(id, "weapon_flashbang")
92 +
93 + if (team == CS_TEAM_T)
94 + give_item(id, "weapon_ak47")
95 + else
96 + give_item(id, "weapon_m4a1")
97 +
98 + give_item(id, "weapon_deagle")
99 +}
100 +
101 +public eventDeath()
102 +{
103 + if (!g_bWarmup)
104 + return
105 +
106 + new victim = read_data(2)
107 +
108 + if (victim >= 1 && victim <= 32)
109 + set_task(1.0, "taskRespawn", victim)
110 +}
111 +
112 +public taskRespawn(id)
113 +{
114 + if (g_bWarmup && is_user_connected(id) && !is_user_alive(id))
115 + {
116 + new team = cs_get_user_team(id)
117 +
118 + if (team == CS_TEAM_T || team == CS_TEAM_CT)
119 + ExecuteHamB(Ham_CS_RoundRespawn, id)
120 + }
121 +}
122 +
123 +public cmdReady(id)
124 +{
125 + if (!g_bWarmup)
126 + {
127 + client_print(id, print_chat, "[CSB] The match is already live.")
128 + return PLUGIN_HANDLED
129 + }
130 +
131 + g_bReady[id] = true
132 +
133 + new name[32]
134 + get_user_name(id, name, charsmax(name))
135 + client_print(0, print_chat, "[CSB] %s is ready.", name)
136 +
137 + checkAllReady()
138 + return PLUGIN_HANDLED
139 +}
140 +
141 +public cmdNotReady(id)
142 +{
143 + if (g_bWarmup)
144 + {
145 + g_bReady[id] = false
146 + client_print(id, print_chat, "[CSB] You are marked NOT ready.")
147 + }
148 +
149 + return PLUGIN_HANDLED
150 +}
151 +
152 +checkAllReady()
153 +{
154 + new players[32], num
155 + get_players(players, num, "ch")
156 +
157 + if (num == 0)
158 + return
159 +
160 + for (new i = 0; i < num; i++)
161 + {
162 + if (!g_bReady[players[i]])
163 + return
164 + }
165 +
166 + endWarmup()
167 +}
168 +
169 +public cmdMatch(id, level, cid)
170 +{
171 + if (!cmd_access(id, level, cid, 1))
172 + return PLUGIN_HANDLED
173 +
174 + if (!g_bWarmup)
175 + {
176 + console_print(id, "[CSB] No warmup is running.")
177 + return PLUGIN_HANDLED
178 + }
179 +
180 + endWarmup()
181 + return PLUGIN_HANDLED
182 +}
183 +
184 +endWarmup()
185 +{
186 + g_bWarmup = false
187 +
188 + set_cvar_num("mp_startmoney", g_iSavedMoney)
189 +
190 + client_print(0, print_chat, "[CSB] Warmup over. LIVE on restart!")
191 + set_cvar_num("sv_restart", 3)
192 +}
193 +
194 +public taskHud()
195 +{
196 + if (!g_bWarmup)
197 + return
198 +
199 + new players[32], num, ready = 0
200 + get_players(players, num, "ch")
201 +
202 + for (new i = 0; i < num; i++)
203 + {
204 + if (g_bReady[players[i]])
205 + ready++
206 + }
207 +
208 + set_hudmessage(0, 255, 100, 0.02, 0.30, 0, 0.0, 1.2, 0.0, 0.0, -1)
209 + ShowSyncHudMsg(0, g_iSync, "WARMUP - %d / %d ready (say /ready)", ready, num)
210 +}
+52 -0 csb.json A
@@ -0,0 +1,52 @@
1 +{
2 + "name": "CSB Match Warmup",
3 + "category": "match",
4 + "tags": "warmup, dm, match",
5 + "image": "",
6 + "original_author": "",
7 + "original_url": "",
8 + "license": "GPL-3.0",
9 + "title": "CSB Match Warmup",
10 + "short_desc": "Pre-match warmup with instant respawn, full money and free weapons that ends when everyone is ready or an admin goes live.",
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": "cstrike,fun,hamsandwich",
20 + "install_notes": "1. Enable the cstrike, fun and hamsandwich modules in addons/amxmodx/configs/modules.ini\n2. Put csb_warmup_manager.amxx in addons/amxmodx/plugins/ and add it to plugins.ini\n3. Change map",
21 + "known_conflicts": "Other respawn or free-for-all plugins will fight the warmup respawn; disable them during matches.",
22 + "cvars": [
23 + {
24 + "name": "csb_wu_enabled",
25 + "default": "1",
26 + "description": "Start a warmup automatically on map load."
27 + },
28 + {
29 + "name": "csb_wu_money",
30 + "default": "16000",
31 + "description": "Money given to players during warmup."
32 + }
33 + ],
34 + "commands": [
35 + {
36 + "name": "say /ready",
37 + "access": "",
38 + "description": "Mark yourself ready; when all are ready the match goes live."
39 + },
40 + {
41 + "name": "say /notready",
42 + "access": "",
43 + "description": "Un-mark yourself as ready."
44 + },
45 + {
46 + "name": "amx_match",
47 + "access": "a (ADMIN_LEVEL_A)",
48 + "description": "Force the warmup to end and go live."
49 + }
50 + ],
51 + "main": "addons/amxmodx/scripting/csb_warmup_manager.sma"
52 +}
0 53