Promoveaza serverul

Initial release 1.0.0

Browse Source
1.0.0 - Initial release.
Daemon666 committed commit 8ce68ecfdf3233647e7757aa405bda9527280ab2
4 changed files with 192 additions and 0 deletions
+3 -0 CHANGELOG.md A
@@ -0,0 +1,3 @@
1 +## 1.0.0 (2025-10-26)
2 +
3 +1.0.0 - Initial release.
+1 -0 README.md A
@@ -0,0 +1 @@
1 +<p><strong>CSB Fireworks</strong> puts on a celebration. It schedules a series of bursts, each an <code>TE_EXPLOSION</code> plus a <code>TE_SPARKS</code> tempent at a random point above a random player, with an explosion sound played to everyone. It runs automatically at round end (great for a holiday event or a match win) and can also be launched on demand with <code>amx_fireworks</code>.</p><h2>Features</h2><ul><li>Round-end shows (toggle with <code>csb_fw_roundend</code>) and the <code>amx_fireworks</code> command.</li><li><code>csb_fw_bursts</code> controls how many bursts go off, spread over time.</li><li>Uses stock CS assets (<code>sprites/zerogxplode.spr</code>, <code>weapons/explode3.wav</code>) - nothing extra to install.</li></ul><h2>Installation</h2><ol><li>Compile <code>csb_fireworks.sma</code> and copy it to <code>addons/amxmodx/plugins/</code>.</li><li>Add it to <code>plugins.ini</code> and change the map.</li></ol><p><code>amx_fireworks</code> needs the <code>ADMIN_LEVEL_A</code> flag (<code>b</code>).</p>
+141 -0 addons/amxmodx/scripting/csb_fireworks.sma A
@@ -0,0 +1,141 @@
1 +/*
2 + * CSB Fireworks
3 + * Copyright (C) 2026 counter-strike-boost.com
4 + *
5 + * Fires a short fireworks show - timed bursts of TE_EXPLOSION and TE_SPARKS
6 + * tempents at random points above the players, each with an explosion sound -
7 + * automatically at round end (a match/holiday celebration) or on the admin
8 + * command amx_fireworks.
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 <fun>
21 +
22 +new const PLUGIN[] = "CSB Fireworks"
23 +new const VERSION[] = "1.0.0"
24 +new const AUTHOR[] = "counter-strike-boost.com"
25 +
26 +#define SVC_TEMPENTITY 23
27 +#define TE_EXPLOSION 3
28 +#define TE_SPARKS 9
29 +
30 +new g_iExploSpr
31 +new g_pEnabled, g_pRoundEnd, g_pBursts
32 +
33 +public plugin_precache()
34 +{
35 + g_iExploSpr = precache_model("sprites/zerogxplode.spr")
36 + precache_sound("weapons/explode3.wav")
37 +}
38 +
39 +public plugin_init()
40 +{
41 + register_plugin(PLUGIN, VERSION, AUTHOR)
42 +
43 + g_pEnabled = register_cvar("csb_fw_enabled", "1")
44 + g_pRoundEnd = register_cvar("csb_fw_roundend", "1")
45 + g_pBursts = register_cvar("csb_fw_bursts", "10")
46 +
47 + register_concmd("amx_fireworks", "cmdFireworks", ADMIN_LEVEL_A, "- launch a fireworks show")
48 + register_logevent("eventRoundEnd", 2, "1=Round_End")
49 +}
50 +
51 +public eventRoundEnd()
52 +{
53 + if (get_pcvar_num(g_pEnabled) && get_pcvar_num(g_pRoundEnd))
54 + startShow()
55 +}
56 +
57 +public cmdFireworks(id, level, cid)
58 +{
59 + if (!cmd_access(id, level, cid, 1))
60 + return PLUGIN_HANDLED
61 +
62 + if (!get_pcvar_num(g_pEnabled))
63 + {
64 + console_print(id, "[CSB] Fireworks are disabled (csb_fw_enabled 0).")
65 + return PLUGIN_HANDLED
66 + }
67 +
68 + new aname[32]
69 + if (id)
70 + get_user_name(id, aname, charsmax(aname))
71 + else
72 + copy(aname, charsmax(aname), "CONSOLE")
73 +
74 + log_amx("[CSB Fireworks] %s launched a show", aname)
75 + startShow()
76 +
77 + return PLUGIN_HANDLED
78 +}
79 +
80 +startShow()
81 +{
82 + new bursts = get_pcvar_num(g_pBursts)
83 + if (bursts < 1)
84 + bursts = 1
85 + if (bursts > 40)
86 + bursts = 40
87 +
88 + for (new i = 0; i < bursts; i++)
89 + set_task(0.3 * float(i) + 0.1, "taskBurst")
90 +}
91 +
92 +public taskBurst()
93 +{
94 + new players[32], num
95 + get_players(players, num, "c")
96 +
97 + new x, y, z
98 +
99 + if (num)
100 + {
101 + new origin[3]
102 + get_user_origin(players[random_num(0, num - 1)], origin)
103 + x = origin[0] + random_num(-300, 300)
104 + y = origin[1] + random_num(-300, 300)
105 + z = origin[2] + random_num(160, 420)
106 + }
107 + else
108 + {
109 + x = random_num(-500, 500)
110 + y = random_num(-500, 500)
111 + z = random_num(200, 500)
112 + }
113 +
114 + /* the burst */
115 + message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
116 + write_byte(TE_EXPLOSION)
117 + write_coord(x)
118 + write_coord(y)
119 + write_coord(z)
120 + write_short(g_iExploSpr)
121 + write_byte(random_num(15, 30)) // scale
122 + write_byte(20) // framerate
123 + write_byte(2) // flags: no sound, no smoke (we handle sound)
124 + message_end()
125 +
126 + /* extra sparkle */
127 + message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
128 + write_byte(TE_SPARKS)
129 + write_coord(x)
130 + write_coord(y)
131 + write_coord(z)
132 + message_end()
133 +
134 + /* boom for everyone */
135 + new pid
136 + for (new i = 0; i < num; i++)
137 + {
138 + pid = players[i]
139 + emit_sound(pid, CHAN_STATIC, "weapons/explode3.wav", 0.6, ATTN_NORM, 0, random_num(90, 120))
140 + }
141 +}
+47 -0 csb.json A
@@ -0,0 +1,47 @@
1 +{
2 + "name": "CSB Fireworks",
3 + "category": "fun",
4 + "tags": "fireworks, effects, celebration",
5 + "image": "",
6 + "original_author": "",
7 + "original_url": "",
8 + "license": "GPL-3.0",
9 + "title": "CSB Fireworks",
10 + "short_desc": "A short fireworks show - timed bursts of explosion and spark tempents above the players with a boom sound - at round end or on the amx_fireworks command.",
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",
20 + "install_notes": "1. Put csb_fireworks.amxx in addons/amxmodx/plugins/\n2. Add it to addons/amxmodx/configs/plugins.ini\n3. Change map",
21 + "known_conflicts": "",
22 + "cvars": [
23 + {
24 + "name": "csb_fw_enabled",
25 + "default": "1",
26 + "description": "Master enable for the show."
27 + },
28 + {
29 + "name": "csb_fw_roundend",
30 + "default": "1",
31 + "description": "Automatically fire a show at round end."
32 + },
33 + {
34 + "name": "csb_fw_bursts",
35 + "default": "10",
36 + "description": "Number of bursts per show (capped at 40)."
37 + }
38 + ],
39 + "commands": [
40 + {
41 + "name": "amx_fireworks",
42 + "access": "b (ADMIN_LEVEL_A)",
43 + "description": "Launch a fireworks show now."
44 + }
45 + ],
46 + "main": "addons/amxmodx/scripting/csb_fireworks.sma"
47 +}
0 48