Promover servidor

Initial release 1.0.0

Browse Source
Initial release.
Daemon666 committed commit 2063f0b06f47a4010dac4e1b41054bb12765bda4
4 changed files with 263 additions and 0 deletions
+3 -0 CHANGELOG.md A
@@ -0,0 +1,3 @@
1 +## 1.0.0 (2025-09-06)
2 +
3 +Initial release.
+1 -0 README.md A
@@ -0,0 +1 @@
1 +<p><strong>CSB Classic Ready System</strong> is a lightweight ready-up plugin for pugs and mixes. Players type <code>/ready</code> or <code>/notready</code>, a HUD shows how many are ready, and once everyone (or the configured minimum) is set the plugin runs a classic <em>Live on 3</em> - three round restarts with a countdown, then LIVE.</p><h2>Features</h2><ul><li><code>/ready</code>, <code>/notready</code> and <code>/readystatus</code> chat commands.</li><li>Live ready count on a synced HUD, per player.</li><li>Minimum-player gate (<code>csb_ready_min</code>) so a half-empty server can't go live.</li><li><code>amx_forcelive</code> for admins to skip the wait.</li></ul><h2>Installation</h2><ol><li>Enable the <code>cstrike</code> module.</li><li>Compile, install, add to <code>plugins.ini</code>, change map.</li></ol>
+212 -0 addons/amxmodx/scripting/csb_classic_ready.sma A
@@ -0,0 +1,212 @@
1 +/*
2 + * CSB Classic Ready System (LO3)
3 + * Copyright (C) 2026 counter-strike-boost.com
4 + *
5 + * A lightweight ready-up plugin for classic 5v5 pugs and mixes. Players type
6 + * !ready / !notready; a HUD shows how many are ready on each side. Once every
7 + * player in the game (or the configured minimum) is ready, the plugin runs a
8 + * classic "Live on 3" — three round restarts with a countdown, then LIVE.
9 + *
10 + * This program is free software: you can redistribute it and/or modify it
11 + * under the terms of the GNU General Public License as published by the Free
12 + * Software Foundation, either version 3 of the License, or (at your option)
13 + * any later version. It is distributed in the hope that it will be useful,
14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
16 + * Public License for more details: <https://www.gnu.org/licenses/>.
17 + */
18 +
19 +#include <amxmodx>
20 +#include <amxmisc>
21 +#include <cstrike>
22 +
23 +new const PLUGIN[] = "CSB Classic Ready System"
24 +new const VERSION[] = "1.0.0"
25 +new const AUTHOR[] = "counter-strike-boost.com"
26 +
27 +new g_pEnabled, g_pMinPlayers
28 +new bool:g_bReady[33]
29 +new bool:g_bLive = false
30 +new bool:g_bStarting = false
31 +new g_iHudSync
32 +
33 +public plugin_init()
34 +{
35 + register_plugin(PLUGIN, VERSION, AUTHOR)
36 +
37 + g_pEnabled = register_cvar("csb_ready_enabled", "1")
38 + g_pMinPlayers = register_cvar("csb_ready_min", "2") /* minimum players before LO3 can fire */
39 +
40 + register_clcmd("say /ready", "cmdReady")
41 + register_clcmd("say_team /ready", "cmdReady")
42 + register_clcmd("say .ready", "cmdReady")
43 + register_clcmd("say !ready", "cmdReady")
44 + register_clcmd("say /notready", "cmdNotReady")
45 + register_clcmd("say_team /notready", "cmdNotReady")
46 + register_clcmd("say !notready", "cmdNotReady")
47 + register_clcmd("say /readystatus", "cmdStatus")
48 +
49 + register_clcmd("amx_forcelive", "cmdForceLive", ADMIN_LEVEL_A, "- skip ready-up and go live now")
50 +
51 + g_iHudSync = CreateHudSyncObj()
52 +}
53 +
54 +public client_disconnected(id)
55 +{
56 + g_bReady[id] = false
57 +}
58 +
59 +public cmdReady(id)
60 +{
61 + if (!get_pcvar_num(g_pEnabled) || g_bLive || g_bStarting)
62 + return PLUGIN_HANDLED
63 +
64 + if (!isPlayer(id))
65 + {
66 + client_print(id, print_chat, "[CSB] Join a team before readying up.")
67 + return PLUGIN_HANDLED
68 + }
69 +
70 + if (g_bReady[id])
71 + {
72 + client_print(id, print_chat, "[CSB] You are already ready. Type /notready to cancel.")
73 + return PLUGIN_HANDLED
74 + }
75 +
76 + g_bReady[id] = true
77 +
78 + new name[32]
79 + get_user_name(id, name, charsmax(name))
80 + client_print(0, print_chat, "[CSB] %s is READY.", name)
81 +
82 + showStatus()
83 + checkAllReady()
84 + return PLUGIN_HANDLED
85 +}
86 +
87 +public cmdNotReady(id)
88 +{
89 + if (!get_pcvar_num(g_pEnabled) || g_bLive)
90 + return PLUGIN_HANDLED
91 +
92 + if (!g_bReady[id])
93 + return PLUGIN_HANDLED
94 +
95 + g_bReady[id] = false
96 +
97 + new name[32]
98 + get_user_name(id, name, charsmax(name))
99 + client_print(0, print_chat, "[CSB] %s is NOT ready.", name)
100 +
101 + showStatus()
102 + return PLUGIN_HANDLED
103 +}
104 +
105 +public cmdStatus(id)
106 +{
107 + showStatus()
108 + return PLUGIN_HANDLED
109 +}
110 +
111 +public cmdForceLive(id, level, cid)
112 +{
113 + if (!cmd_access(id, level, cid, 1))
114 + return PLUGIN_HANDLED
115 +
116 + if (g_bLive || g_bStarting)
117 + {
118 + client_print(id, print_chat, "[CSB] The match is already live or starting.")
119 + return PLUGIN_HANDLED
120 + }
121 +
122 + client_print(0, print_chat, "[CSB] An admin forced the match live.")
123 + startLiveOnThree()
124 + return PLUGIN_HANDLED
125 +}
126 +
127 +isPlayer(id)
128 +{
129 + if (!is_user_connected(id))
130 + return 0
131 +
132 + new CsTeams:team = cs_get_user_team(id)
133 + return (team == CS_TEAM_T || team == CS_TEAM_CT) ? 1 : 0
134 +}
135 +
136 +countReady(&total)
137 +{
138 + new players[32], num, ready = 0
139 + total = 0
140 + get_players(players, num, "ch")
141 +
142 + for (new i = 0; i < num; i++)
143 + {
144 + new pid = players[i]
145 + if (!isPlayer(pid))
146 + continue
147 +
148 + total++
149 + if (g_bReady[pid])
150 + ready++
151 + }
152 +
153 + return ready
154 +}
155 +
156 +showStatus()
157 +{
158 + new total, ready = countReady(total)
159 +
160 + set_hudmessage(0, 200, 255, 0.02, 0.20, 0, 0.0, 4.0, 0.0, 0.1, -1)
161 + ShowSyncHudMsg(0, g_iHudSync, "READY: %d / %d^nType /ready when set", ready, total)
162 +}
163 +
164 +checkAllReady()
165 +{
166 + if (g_bLive || g_bStarting)
167 + return
168 +
169 + new total, ready = countReady(total)
170 + new minP = get_pcvar_num(g_pMinPlayers)
171 +
172 + if (total < minP)
173 + return
174 +
175 + if (ready >= total && total > 0)
176 + startLiveOnThree()
177 +}
178 +
179 +startLiveOnThree()
180 +{
181 + g_bStarting = true
182 +
183 + client_print(0, print_chat, "[CSB] All players ready - LIVE ON 3!")
184 +
185 + set_task(0.5, "taskLo3", 5551) /* restart 1 -> "3" */
186 + set_task(3.0, "taskLo3", 5552) /* restart 2 -> "2" */
187 + set_task(5.5, "taskLo3", 5553) /* restart 3 -> "1" */
188 + set_task(8.0, "taskGoLive", 5554)
189 +}
190 +
191 +public taskLo3(id)
192 +{
193 + new step = id - 5550
194 + new label = 4 - step /* 3, 2, 1 */
195 +
196 + server_cmd("sv_restartround 1")
197 +
198 + set_hudmessage(255, 80, 80, -1.0, 0.35, 0, 0.0, 2.0, 0.0, 0.0, -1)
199 + show_hudmessage(0, "LIVE ON %d...", label)
200 +}
201 +
202 +public taskGoLive()
203 +{
204 + g_bLive = true
205 + g_bStarting = false
206 +
207 + server_cmd("sv_restartround 1")
208 +
209 + set_hudmessage(0, 255, 100, -1.0, 0.35, 2, 0.5, 4.0, 0.1, 0.2, -1)
210 + show_hudmessage(0, "* LIVE * LIVE * LIVE *")
211 + client_print(0, print_chat, "[CSB] The match is now LIVE. Good luck!")
212 +}
+47 -0 csb.json A
@@ -0,0 +1,47 @@
1 +{
2 + "name": "CSB Classic Ready System",
3 + "category": "classic",
4 + "tags": "ready, lo3, live on 3, pug, mix, match",
5 + "image": "",
6 + "original_author": "",
7 + "original_url": "",
8 + "license": "GPL-3.0",
9 + "title": "CSB Classic Ready System (LO3)",
10 + "short_desc": "!ready / !notready ready-up with a live HUD count, then a classic Live-on-3 restart sequence once everyone is set.",
11 + "version": "1.0.0",
12 + "amxx_min": "1.8.2",
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",
20 + "install_notes": "1. Enable the cstrike module in addons/amxmodx/configs/modules.ini\n2. Compile the .sma (or use the site compiler) and put the .amxx in addons/amxmodx/plugins/\n3. Add csb_classic_ready.amxx to addons/amxmodx/configs/plugins.ini\n4. Change the map. Tune csb_ready_min for your roster size.",
21 + "known_conflicts": "Other ready/LO3 match plugins.",
22 + "cvars": [
23 + {
24 + "name": "csb_ready_enabled",
25 + "default": "1",
26 + "description": "Master enable toggle."
27 + },
28 + {
29 + "name": "csb_ready_min",
30 + "default": "2",
31 + "description": "Minimum players in-game before Live-on-3 can fire."
32 + }
33 + ],
34 + "commands": [
35 + {
36 + "name": "say /ready, /notready, /readystatus",
37 + "access": "",
38 + "description": "Ready up, cancel, or show the ready count."
39 + },
40 + {
41 + "name": "amx_forcelive",
42 + "access": "ADMIN_LEVEL_A",
43 + "description": "Skip ready-up and start Live-on-3 now."
44 + }
45 + ],
46 + "main": "addons/amxmodx/scripting/csb_classic_ready.sma"
47 +}
0 48