Продвинуть сервер

Initial release 1.0.0

Browse Source
1.0.0 - Initial release.
Daemon666 committed commit f3dec4b47db513309f45dee2fd2091ba0ce48135
4 changed files with 281 additions and 0 deletions
+3 -0 CHANGELOG.md A
@@ -0,0 +1,3 @@
1 +## 1.0.0 (2026-04-01)
2 +
3 +1.0.0 - Initial release.
+1 -0 README.md A
@@ -0,0 +1 @@
1 +<p><strong>CSB Quake Sounds</strong> is the Quake announcer everyone remembers. A <code>DeathMsg</code> hook tracks kill timings and streaks and plays the right sound: <em>first blood</em> on the first kill of the round, <em>double/multi/ultra kill</em> for kills chained inside a short window, <em>godlike</em> for a five-kill streak, a <em>headshot</em> cue to the killer and a <em>humiliation</em> sting to anyone knifed.</p><h2>Features</h2><ul><li>Combo detection with a configurable window (<code>csb_quake_window</code>, default 3 seconds).</li><li>Streaks reset on death; first blood resets each round.</li><li>Headshot and knife-kill (humiliation) detection.</li><li>Per-player <code>/qsounds</code> toggle saved in nVault, so a player who hates it never hears it again.</li><li>Only sounds that exist are precached; a missing file just disables that one announce.</li></ul><h2>Sounds</h2><p>Place your WAV files in <code>cstrike/sound/csb_quake/</code> (firstblood.wav, doublekill.wav, multikill.wav, ultrakill.wav, godlike.wav, headshot.wav, humiliation.wav) and add them to your fastdl so clients download them.</p><h2>Installation</h2><ol><li>Enable the <code>fun</code> and <code>nvault</code> modules in <code>modules.ini</code>.</li><li>Compile, copy <code>csb_quake_sounds.amxx</code> into <code>plugins/</code>, add it to <code>plugins.ini</code>.</li><li>Upload the sounds and change the map.</li></ol><p>Inspired by the original &quot;Quake Sounds&quot; plugin (Vexd and the AMXX community); independent GPL re-implementation.</p>
+235 -0 addons/amxmodx/scripting/csb_quake_sounds.sma A
@@ -0,0 +1,235 @@
1 +/*
2 + * CSB Quake Sounds
3 + * Copyright (C) 2026 counter-strike-boost.com
4 + *
5 + * The classic Quake announcer for CS 1.6. A DeathMsg hook tracks kill timings
6 + * and streaks and plays firstblood, doublekill, multikill, ultrakill, godlike,
7 + * headshot and humiliation (knife-kill) sounds. Each player can turn the sounds
8 + * off for themselves with /qsounds, and the choice is saved in nVault.
9 + *
10 + * Inspired by the original "Quake Sounds" plugin (Vexd / the AMXX community).
11 + * This is an independent GPL re-implementation; no original code is reused.
12 + *
13 + * This program is free software: you can redistribute it and/or modify it under
14 + * the terms of the GNU General Public License as published by the Free Software
15 + * Foundation, either version 3 of the License, or (at your option) any later
16 + * version. It is distributed in the hope that it will be useful, but WITHOUT ANY
17 + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
18 + * A PARTICULAR PURPOSE. See <https://www.gnu.org/licenses/> for details.
19 + */
20 +
21 +#include <amxmodx>
22 +#include <fun>
23 +#include <nvault>
24 +
25 +new const PLUGIN[] = "CSB Quake Sounds"
26 +new const VERSION[] = "1.0.0"
27 +new const AUTHOR[] = "counter-strike-boost.com"
28 +
29 +#define NO_VAULT (-1)
30 +
31 +enum _:Snd
32 +{
33 + SND_FIRSTBLOOD = 0,
34 + SND_DOUBLE,
35 + SND_MULTI,
36 + SND_ULTRA,
37 + SND_GODLIKE,
38 + SND_HEADSHOT,
39 + SND_HUMILIATION
40 +}
41 +
42 +new const g_szSounds[Snd][] =
43 +{
44 + "csb_quake/firstblood.wav",
45 + "csb_quake/doublekill.wav",
46 + "csb_quake/multikill.wav",
47 + "csb_quake/ultrakill.wav",
48 + "csb_quake/godlike.wav",
49 + "csb_quake/headshot.wav",
50 + "csb_quake/humiliation.wav"
51 +}
52 +
53 +new bool:g_bSoundOk[Snd]
54 +
55 +new g_iCombo[33]
56 +new Float:g_fLastKill[33]
57 +new bool:g_bEnabled[33]
58 +new g_szAuth[33][35]
59 +
60 +new bool:g_bFirstBlood
61 +new g_iVault = NO_VAULT
62 +new g_pEnabled, g_pComboWindow
63 +
64 +public plugin_init()
65 +{
66 + register_plugin(PLUGIN, VERSION, AUTHOR)
67 +
68 + g_pEnabled = register_cvar("csb_quake_enabled", "1")
69 + g_pComboWindow = register_cvar("csb_quake_window", "3.0")
70 +
71 + register_event("DeathMsg", "fwDeath", "a")
72 + register_event("HLTV", "eNewRound", "a", "1=0", "2=0")
73 +
74 + register_clcmd("say /qsounds", "cmdToggle")
75 + register_clcmd("say_team /qsounds", "cmdToggle")
76 +}
77 +
78 +public plugin_precache()
79 +{
80 + new full[128]
81 +
82 + for (new i = 0; i < Snd; i++)
83 + {
84 + formatex(full, charsmax(full), "sound/%s", g_szSounds[i])
85 +
86 + if (file_exists(full))
87 + {
88 + precache_sound(g_szSounds[i])
89 + g_bSoundOk[i] = true
90 + }
91 + else
92 + {
93 + log_amx("[CSB Quake] missing sound %s - that announce is disabled.", full)
94 + }
95 + }
96 +}
97 +
98 +public plugin_cfg()
99 +{
100 + g_iVault = nvault_open("csb_quake_sounds")
101 +
102 + if (g_iVault == NO_VAULT)
103 + log_amx("[CSB Quake] could not open nVault - toggles will not persist.")
104 +}
105 +
106 +public plugin_end()
107 +{
108 + if (g_iVault != NO_VAULT)
109 + nvault_close(g_iVault)
110 +}
111 +
112 +public client_authorized(id)
113 +{
114 + g_iCombo[id] = 0
115 + g_fLastKill[id] = 0.0
116 + g_bEnabled[id] = true
117 +
118 + if (is_user_bot(id) || is_user_hltv(id))
119 + return
120 +
121 + get_user_authid(id, g_szAuth[id], charsmax(g_szAuth[]))
122 +
123 + if (g_iVault == NO_VAULT)
124 + return
125 +
126 + new value[4]
127 +
128 + if (nvault_get(g_iVault, g_szAuth[id], value, charsmax(value)))
129 + g_bEnabled[id] = (str_to_num(value) != 0)
130 +}
131 +
132 +public cmdToggle(id)
133 +{
134 + g_bEnabled[id] = !g_bEnabled[id]
135 +
136 + client_print(id, print_chat, "[CSB] Quake sounds are now %s for you.", g_bEnabled[id] ? "ON" : "OFF")
137 +
138 + if (g_iVault != NO_VAULT && g_szAuth[id][0])
139 + {
140 + new value[4]
141 + num_to_str(g_bEnabled[id] ? 1 : 0, value, charsmax(value))
142 + nvault_set(g_iVault, g_szAuth[id], value)
143 + }
144 +
145 + return PLUGIN_HANDLED
146 +}
147 +
148 +public eNewRound()
149 +{
150 + g_bFirstBlood = false
151 +
152 + for (new i = 1; i <= 32; i++)
153 + {
154 + g_iCombo[i] = 0
155 + g_fLastKill[i] = 0.0
156 + }
157 +}
158 +
159 +public fwDeath()
160 +{
161 + if (!get_pcvar_num(g_pEnabled))
162 + return
163 +
164 + new killer = read_data(1)
165 + new victim = read_data(2)
166 + new headshot = read_data(3)
167 +
168 + /* reset the victim's streak */
169 + if (victim >= 1 && victim <= 32)
170 + g_iCombo[victim] = 0
171 +
172 + if (killer < 1 || killer > 32 || killer == victim || !is_user_connected(killer))
173 + return
174 +
175 + /* humiliation: killed with the knife -> tell the victim */
176 + if (get_user_weapon(killer) == CSW_KNIFE)
177 + playToOne(victim, SND_HUMILIATION)
178 +
179 + /* first blood of the round */
180 + if (!g_bFirstBlood)
181 + {
182 + g_bFirstBlood = true
183 + playToAll(SND_FIRSTBLOOD)
184 + }
185 +
186 + /* headshot announce goes to the killer */
187 + if (headshot)
188 + playToOne(killer, SND_HEADSHOT)
189 +
190 + /* combo window */
191 + new Float:now = get_gametime()
192 + new Float:window = get_pcvar_float(g_pComboWindow)
193 +
194 + if (g_fLastKill[killer] > 0.0 && (now - g_fLastKill[killer]) <= window)
195 + g_iCombo[killer]++
196 + else
197 + g_iCombo[killer] = 1
198 +
199 + g_fLastKill[killer] = now
200 +
201 + switch (g_iCombo[killer])
202 + {
203 + case 2: playToAll(SND_DOUBLE)
204 + case 3: playToAll(SND_MULTI)
205 + case 4: playToAll(SND_ULTRA)
206 + }
207 +
208 + if (g_iCombo[killer] >= 5)
209 + playToAll(SND_GODLIKE)
210 +}
211 +
212 +playToAll(snd)
213 +{
214 + if (!g_bSoundOk[snd])
215 + return
216 +
217 + new players[32], num, pid
218 + get_players(players, num, "c")
219 +
220 + for (new i = 0; i < num; i++)
221 + {
222 + pid = players[i]
223 +
224 + if (g_bEnabled[pid])
225 + emit_sound(pid, CHAN_STATIC, g_szSounds[snd], 1.0, 0.0, 0, PITCH_NORM)
226 + }
227 +}
228 +
229 +playToOne(id, snd)
230 +{
231 + if (!g_bSoundOk[snd] || id < 1 || id > 32 || !is_user_connected(id) || !g_bEnabled[id])
232 + return
233 +
234 + emit_sound(id, CHAN_STATIC, g_szSounds[snd], 1.0, 0.0, 0, PITCH_NORM)
235 +}
+42 -0 csb.json A
@@ -0,0 +1,42 @@
1 +{
2 + "name": "CSB Quake Sounds",
3 + "category": "fun",
4 + "tags": "quake, sounds, killstreak",
5 + "image": "",
6 + "original_author": "Vexd / AMXX community (Quake Sounds)",
7 + "original_url": "",
8 + "license": "GPL-3.0",
9 + "title": "CSB Quake Sounds",
10 + "short_desc": "The classic Quake announcer: firstblood, doublekill, multikill, ultrakill, godlike, headshot and knife-kill humiliation, with a per-player /qsounds toggle saved in nVault.",
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": "fun,nvault",
20 + "install_notes": "1. Enable the fun and nvault modules in modules.ini\n2. Put csb_quake_sounds.amxx in addons/amxmodx/plugins/ and add it to plugins.ini\n3. Upload the WAVs to cstrike/sound/csb_quake/ and add them to fastdl\n4. Change map",
21 + "known_conflicts": "Other quake/killstreak sound plugins - run only one.",
22 + "cvars": [
23 + {
24 + "name": "csb_quake_enabled",
25 + "default": "1",
26 + "description": "Enable or disable the announcer globally."
27 + },
28 + {
29 + "name": "csb_quake_window",
30 + "default": "3.0",
31 + "description": "Seconds within which consecutive kills count as a combo."
32 + }
33 + ],
34 + "commands": [
35 + {
36 + "name": "say /qsounds",
37 + "access": "",
38 + "description": "Toggle Quake sounds for yourself."
39 + }
40 + ],
41 + "main": "addons/amxmodx/scripting/csb_quake_sounds.sma"
42 +}
0 43