Sunucu tanitimi

Initial release 1.0.0

Browse Source
1.0.0 - Initial release.
Daemon666 committed commit d258732f5ff1e02276765fd6ba6903a726aeefb2
4 changed files with 184 additions and 0 deletions
+3 -0 CHANGELOG.md A
@@ -0,0 +1,3 @@
1 +## 1.0.0 (2025-12-17)
2 +
3 +1.0.0 - Initial release.
+1 -0 README.md A
@@ -0,0 +1 @@
1 +<p><strong>CSB Thunderstorm</strong> adds atmosphere to any map. On a schedule whose frequency scales with an intensity cvar, the sky flashes: a brief white <code>ScreenFade</code> plus a bright <code>TE_DLIGHT</code> above each player, followed a beat later by a thunder sound. Admins can call a strike on demand with <code>amx_thunder</code>. It is purely cosmetic and changes nothing about gameplay.</p><h2>Features</h2><ul><li>Randomised lightning flashes with dynamic light.</li><li>Thunder sound played to every client.</li><li>Intensity cvar controls how often storms roll in.</li><li><code>amx_thunder</code> triggers a strike on demand.</li></ul><h2>Installation</h2><ol><li>Compile <code>csb_thunderstorm.sma</code>, copy it to <code>addons/amxmodx/plugins/</code> and add it to <code>plugins.ini</code>.</li><li>Make sure a thunder sound exists at <code>sound/ambience/thunder_clap.wav</code> or edit the path in the source.</li><li>Change the map.</li></ol>
+138 -0 addons/amxmodx/scripting/csb_thunderstorm.sma A
@@ -0,0 +1,138 @@
1 +/*
2 + * CSB Thunderstorm
3 + * Copyright (C) 2026 counter-strike-boost.com
4 + *
5 + * A weather ambience layer. On a periodic schedule (frequency scaled by an
6 + * intensity cvar) the sky flashes: a brief white ScreenFade plus a bright
7 + * TE_DLIGHT above the player, followed by a thunder sound. Admins can trigger a
8 + * flash on demand. Purely cosmetic; nothing about gameplay changes.
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 +
21 +new const PLUGIN[] = "CSB Thunderstorm"
22 +new const VERSION[] = "1.0.0"
23 +new const AUTHOR[] = "counter-strike-boost.com"
24 +
25 +#define THUNDER_SOUND "ambience/thunder_clap.wav"
26 +
27 +new g_pEnabled, g_pIntensity
28 +new g_iMsgScreenFade
29 +
30 +public plugin_init()
31 +{
32 + register_plugin(PLUGIN, VERSION, AUTHOR)
33 +
34 + g_pEnabled = register_cvar("csb_storm_enabled", "1")
35 + g_pIntensity = register_cvar("csb_storm_intensity", "5")
36 +
37 + g_iMsgScreenFade = get_user_msgid("ScreenFade")
38 +
39 + register_concmd("amx_thunder", "cmdThunder", ADMIN_LEVEL_A, "- trigger a lightning flash now")
40 +
41 + scheduleNext()
42 +}
43 +
44 +public plugin_precache()
45 +{
46 + precache_sound(THUNDER_SOUND)
47 +}
48 +
49 +scheduleNext()
50 +{
51 + new intensity = get_pcvar_num(g_pIntensity)
52 +
53 + if (intensity < 1)
54 + intensity = 1
55 + else if (intensity > 10)
56 + intensity = 10
57 +
58 + new Float:base = 30.0 - float(intensity) * 2.5
59 + new Float:delay = base + float(random_num(0, 8))
60 +
61 + if (delay < 3.0)
62 + delay = 3.0
63 +
64 + set_task(delay, "taskStorm", 7788)
65 +}
66 +
67 +public taskStorm()
68 +{
69 + if (get_pcvar_num(g_pEnabled))
70 + strike()
71 +
72 + scheduleNext()
73 +}
74 +
75 +public cmdThunder(id, level, cid)
76 +{
77 + if (!cmd_access(id, level, cid, 1))
78 + return PLUGIN_HANDLED
79 +
80 + strike()
81 +
82 + new name[32]
83 + get_user_name(id, name, charsmax(name))
84 + client_print(0, print_chat, "[CSB] %s summoned a thunderstrike.", name)
85 + return PLUGIN_HANDLED
86 +}
87 +
88 +strike()
89 +{
90 + new players[32], num
91 + get_players(players, num, "c")
92 +
93 + for (new i = 0; i < num; i++)
94 + {
95 + new id = players[i]
96 +
97 + /* white flash */
98 + message_begin(MSG_ONE, g_iMsgScreenFade, _, id)
99 + write_short(1 << 10)
100 + write_short(1 << 8)
101 + write_short(0)
102 + write_byte(255)
103 + write_byte(255)
104 + write_byte(255)
105 + write_byte(160)
106 + message_end()
107 +
108 + if (is_user_alive(id))
109 + {
110 + new origin[3]
111 + get_user_origin(id, origin)
112 +
113 + message_begin(MSG_ONE, SVC_TEMPENTITY, _, id)
114 + write_byte(TE_DLIGHT)
115 + write_coord(origin[0])
116 + write_coord(origin[1])
117 + write_coord(origin[2] + 300)
118 + write_byte(40)
119 + write_byte(255)
120 + write_byte(255)
121 + write_byte(255)
122 + write_byte(4)
123 + write_byte(40)
124 + message_end()
125 + }
126 + }
127 +
128 + set_task(0.6, "taskThunder", 7799)
129 +}
130 +
131 +public taskThunder()
132 +{
133 + new players[32], num
134 + get_players(players, num, "ch")
135 +
136 + for (new i = 0; i < num; i++)
137 + client_cmd(players[i], "play %s", THUNDER_SOUND)
138 +}
+42 -0 csb.json A
@@ -0,0 +1,42 @@
1 +{
2 + "name": "CSB Thunderstorm",
3 + "category": "fun",
4 + "tags": "weather, lightning, ambience",
5 + "image": "",
6 + "original_author": "",
7 + "original_url": "",
8 + "license": "GPL-3.0",
9 + "title": "CSB Thunderstorm",
10 + "short_desc": "A weather ambience layer: periodic lightning flashes (ScreenFade + dynamic light) and thunder, with an intensity cvar and an admin trigger.",
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": "",
20 + "install_notes": "1. Put csb_thunderstorm.amxx in addons/amxmodx/plugins/ and add it to plugins.ini\n2. Ensure sound/ambience/thunder_clap.wav exists (stock Half-Life sound)\n3. Change map",
21 + "known_conflicts": "The ScreenFade flash briefly whitens the screen; disable during competitive rounds if undesired.",
22 + "cvars": [
23 + {
24 + "name": "csb_storm_enabled",
25 + "default": "1",
26 + "description": "Enable or disable the storm."
27 + },
28 + {
29 + "name": "csb_storm_intensity",
30 + "default": "5",
31 + "description": "Storm frequency from 1 (rare) to 10 (frequent)."
32 + }
33 + ],
34 + "commands": [
35 + {
36 + "name": "amx_thunder",
37 + "access": "a (ADMIN_LEVEL_A)",
38 + "description": "Trigger a lightning flash now."
39 + }
40 + ],
41 + "main": "addons/amxmodx/scripting/csb_thunderstorm.sma"
42 +}
0 43