Promoveaza serverul

Initial release 1.0.0

Browse Source
1.0.0 - Initial release.
Daemon666 committed commit da69bb9c7469fca31d831ce41875cd875214a511
4 changed files with 190 additions and 0 deletions
+3 -0 CHANGELOG.md A
@@ -0,0 +1,3 @@
1 +## 1.0.0 (2026-05-24)
2 +
3 +1.0.0 - Initial release.
+1 -0 README.md A
@@ -0,0 +1 @@
1 +<p><strong>CSB Death Effects</strong> makes kills look better. When a player dies the plugin reads the <code>DeathMsg</code> event and sends temp entities at the victim's position: a blood burst, a gib shower, and &mdash; for headshot or knife kills &mdash; an extra explosion. Each effect is independently toggled by a cvar, and a short per-victim cooldown keeps a chaotic round from flooding the network.</p><h2>Features</h2><ul><li>Blood burst (<code>TE_BLOODSPRITE</code>) and gib shower (<code>TE_BREAKMODEL</code>).</li><li>Bonus explosion (<code>TE_EXPLOSION</code>) on headshot or knife kills.</li><li>Effects sent as <code>MSG_PVS</code> temp entities &mdash; only nearby players receive them.</li><li>Per-effect cvars and a per-victim rate limit.</li></ul><h2>Installation</h2><ol><li>Compile <code>csb_death_effects.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>No extra modules are required; the sprites and gib model used are stock Half-Life assets.</p>
+140 -0 addons/amxmodx/scripting/csb_death_effects.sma A
@@ -0,0 +1,140 @@
1 +/*
2 + * CSB Death Effects
3 + * Copyright (C) 2026 counter-strike-boost.com
4 + *
5 + * Adds extra visual flair to kills: a blood burst and gib shower at the victim's
6 + * position, plus an optional explosion for headshot or knife kills. Everything
7 + * is sent as temp entities to nearby players, each effect is cvar-toggled, and a
8 + * short per-victim cooldown keeps the effects from spamming the network.
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 +
20 +new const PLUGIN[] = "CSB Death Effects"
21 +new const VERSION[] = "1.0.0"
22 +new const AUTHOR[] = "counter-strike-boost.com"
23 +
24 +#define TE_EXPLOSION 3
25 +#define TE_BLOODSPRITE 115
26 +
27 +new const g_szExplode[] = "sprites/zerogxplode.spr"
28 +new const g_szBloodSpray[] = "sprites/bloodspray.spr"
29 +new const g_szBloodDrop[] = "sprites/blood.spr"
30 +new const g_szGibs[] = "models/hgibs.mdl"
31 +
32 +new g_pEnabled, g_pBlood, g_pGibs, g_pExplode
33 +new g_iSprExplode, g_iSprSpray, g_iSprDrop, g_iMdlGibs
34 +new Float:g_fLastFx[33]
35 +
36 +public plugin_init()
37 +{
38 + register_plugin(PLUGIN, VERSION, AUTHOR)
39 +
40 + g_pEnabled = register_cvar("csb_deathfx_enabled", "1")
41 + g_pBlood = register_cvar("csb_deathfx_blood", "1")
42 + g_pGibs = register_cvar("csb_deathfx_gibs", "1")
43 + g_pExplode = register_cvar("csb_deathfx_explode", "1")
44 +
45 + register_event("DeathMsg", "eventDeath", "a", "1>0")
46 +}
47 +
48 +public plugin_precache()
49 +{
50 + g_iSprExplode = precache_model(g_szExplode)
51 + g_iSprSpray = precache_model(g_szBloodSpray)
52 + g_iSprDrop = precache_model(g_szBloodDrop)
53 + g_iMdlGibs = precache_model(g_szGibs)
54 +}
55 +
56 +public eventDeath()
57 +{
58 + if (!get_pcvar_num(g_pEnabled))
59 + return
60 +
61 + new victim = read_data(2)
62 + new hs = read_data(3)
63 +
64 + if (victim < 1 || victim > 32 || !is_user_connected(victim))
65 + return
66 +
67 + /* rate limit per victim slot */
68 + if (get_gametime() - g_fLastFx[victim] < 0.3)
69 + return
70 +
71 + g_fLastFx[victim] = get_gametime()
72 +
73 + new weapon[32]
74 + read_data(4, weapon, charsmax(weapon))
75 + new bool:knife = (containi(weapon, "knife") != -1)
76 +
77 + static iOrigin[3], Float:fOrigin[3]
78 + get_user_origin(victim, iOrigin)
79 + fOrigin[0] = float(iOrigin[0])
80 + fOrigin[1] = float(iOrigin[1])
81 + fOrigin[2] = float(iOrigin[2])
82 +
83 + if (get_pcvar_num(g_pBlood))
84 + bloodBurst(fOrigin, iOrigin)
85 +
86 + if (get_pcvar_num(g_pGibs))
87 + gibShower(fOrigin, iOrigin)
88 +
89 + if (get_pcvar_num(g_pExplode) && (hs || knife))
90 + explosion(fOrigin, iOrigin)
91 +}
92 +
93 +bloodBurst(const Float:fOrigin[3], const iOrigin[3])
94 +{
95 + message_begin_f(MSG_PVS, SVC_TEMPENTITY, fOrigin)
96 + write_byte(TE_BLOODSPRITE)
97 + write_coord(iOrigin[0])
98 + write_coord(iOrigin[1])
99 + write_coord(iOrigin[2] + 12)
100 + write_short(g_iSprSpray)
101 + write_short(g_iSprDrop)
102 + write_byte(70) /* red blood colour index */
103 + write_byte(12) /* scale */
104 + message_end()
105 +}
106 +
107 +gibShower(const Float:fOrigin[3], const iOrigin[3])
108 +{
109 + message_begin_f(MSG_PVS, SVC_TEMPENTITY, fOrigin)
110 + write_byte(TE_BREAKMODEL)
111 + write_coord(iOrigin[0])
112 + write_coord(iOrigin[1])
113 + write_coord(iOrigin[2] + 24)
114 + write_coord(16) /* size x */
115 + write_coord(16) /* size y */
116 + write_coord(16) /* size z */
117 + write_coord(0) /* velocity x */
118 + write_coord(0) /* velocity y */
119 + write_coord(80) /* velocity z */
120 + write_byte(120) /* random velocity */
121 + write_short(g_iMdlGibs)
122 + write_byte(12) /* count */
123 + write_byte(25) /* life (*0.1s) */
124 + write_byte(0x02) /* flags: BREAK_FLESH */
125 + message_end()
126 +}
127 +
128 +explosion(const Float:fOrigin[3], const iOrigin[3])
129 +{
130 + message_begin_f(MSG_PVS, SVC_TEMPENTITY, fOrigin)
131 + write_byte(TE_EXPLOSION)
132 + write_coord(iOrigin[0])
133 + write_coord(iOrigin[1])
134 + write_coord(iOrigin[2] + 16)
135 + write_short(g_iSprExplode)
136 + write_byte(10) /* scale */
137 + write_byte(20) /* framerate */
138 + write_byte(0x01) /* TE_EXPLFLAG_NOADDITIVE off / no sound flag stub */
139 + message_end()
140 +}
+46 -0 csb.json A
@@ -0,0 +1,46 @@
1 +{
2 + "name": "CSB Death Effects",
3 + "category": "fun",
4 + "tags": "death, blood, gibs",
5 + "image": "",
6 + "original_author": "",
7 + "original_url": "",
8 + "license": "GPL-3.0",
9 + "title": "CSB Death Effects",
10 + "short_desc": "Blood burst, gib shower and an optional explosion on headshot/knife kills, sent as temp entities.",
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_death_effects.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_deathfx_enabled",
25 + "default": "1",
26 + "description": "Enable or disable death effects."
27 + },
28 + {
29 + "name": "csb_deathfx_blood",
30 + "default": "1",
31 + "description": "Show a blood burst at the death position."
32 + },
33 + {
34 + "name": "csb_deathfx_gibs",
35 + "default": "1",
36 + "description": "Show a gib shower at the death position."
37 + },
38 + {
39 + "name": "csb_deathfx_explode",
40 + "default": "1",
41 + "description": "Add an explosion on headshot or knife kills."
42 + }
43 + ],
44 + "commands": [],
45 + "main": "addons/amxmodx/scripting/csb_death_effects.sma"
46 +}
0 47