Promote server

Initial release 1.0.0

Browse Source
1.0.0 - Initial release.
Daemon666 committed commit 82e8a63250f187cce7db2eb64180b4fafd2822fd
4 changed files with 246 additions and 0 deletions
+3 -0 CHANGELOG.md A
@@ -0,0 +1,3 @@
1 +## 1.0.0 (2026-02-08)
2 +
3 +1.0.0 - Initial release.
+1 -0 README.md A
@@ -0,0 +1 @@
1 +<p><strong>CSB Chicken Grenade</strong> is pure fun-mode chaos. Every thrown HE grenade is re-skinned with a chicken model, and just before it detonates it hatches a flock of chicken entities that scatter with random velocities. Each chicken arms a short fuse and then pops with a cluck, an explosion sprite and scaled blast damage in a radius around it.</p><p>Inspired by the classic Chicken Grenade / Chicken Mod idea. Independent GPL re-implementation.</p><h2>Features</h2><ul><li>HE grenade model swapped to a chicken on throw.</li><li>Hatches <code>csb_chick_count</code> chickens that scatter and pop individually.</li><li>Each pop applies distance-scaled <code>DMG_BLAST</code> damage, credited to the thrower.</li><li>Explosion sprite plus cluck sound per chicken.</li></ul><h2>Installation</h2><ol><li>Enable the <code>fakemeta</code>, <code>hamsandwich</code> and <code>fun</code> modules in <code>modules.ini</code>.</li><li>Put a <code>chick.mdl</code> in <code>models/</code> (any chicken model) or edit the model path in the source.</li><li>Compile <code>csb_chicken_grenade.sma</code>, copy it to <code>addons/amxmodx/plugins/</code> and add it to <code>plugins.ini</code>.</li><li>Change the map.</li></ol>
+196 -0 addons/amxmodx/scripting/csb_chicken_grenade.sma A
@@ -0,0 +1,196 @@
1 +/*
2 + * CSB Chicken Grenade
3 + * Copyright (C) 2026 counter-strike-boost.com
4 + *
5 + * Turns the HE grenade into a chicken bomb: the thrown grenade wears a chicken
6 + * model, and just before it detonates it hatches several chicken entities that
7 + * scatter and pop one by one, each dealing scaled blast damage around it.
8 + *
9 + * Inspired by the classic Chicken Grenade / Chicken Mod idea. Independent GPL
10 + * re-implementation; no original code is reused.
11 + *
12 + * This program is free software: you can redistribute it and/or modify it under
13 + * the terms of the GNU General Public License as published by the Free Software
14 + * Foundation, either version 3 of the License, or (at your option) any later
15 + * version. It is distributed in the hope that it will be useful, but WITHOUT
16 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 + * FOR A PARTICULAR PURPOSE. See <https://www.gnu.org/licenses/> for details.
18 + */
19 +
20 +#include <amxmodx>
21 +#include <fakemeta>
22 +#include <hamsandwich>
23 +#include <fun>
24 +
25 +new const PLUGIN[] = "CSB Chicken Grenade"
26 +new const VERSION[] = "1.0.0"
27 +new const AUTHOR[] = "counter-strike-boost.com"
28 +
29 +#define TE_EXPLOSION 3
30 +#define CHICK_CLASS "csb_chick"
31 +
32 +new const g_szChickenModel[] = "models/chick.mdl"
33 +new const g_szHeModel[] = "models/w_hegrenade.mdl"
34 +new const g_szCluckSound[] = "player/pl_duck1.wav"
35 +
36 +new g_pEnabled, g_pCount, g_pDamage, g_pRadius
37 +new g_iSprExplode
38 +new g_iMaxPlayers
39 +
40 +public plugin_init()
41 +{
42 + register_plugin(PLUGIN, VERSION, AUTHOR)
43 +
44 + g_pEnabled = register_cvar("csb_chick_enabled", "1")
45 + g_pCount = register_cvar("csb_chick_count", "5")
46 + g_pDamage = register_cvar("csb_chick_damage", "50")
47 + g_pRadius = register_cvar("csb_chick_radius", "140")
48 +
49 + register_forward(FM_SetModel, "fwSetModel")
50 + register_forward(FM_Think, "fwThink")
51 +
52 + g_iMaxPlayers = get_maxplayers()
53 +}
54 +
55 +public plugin_precache()
56 +{
57 + g_iSprExplode = precache_model("sprites/zerogxplode.spr")
58 + precache_model(g_szChickenModel)
59 + precache_sound(g_szCluckSound)
60 +}
61 +
62 +public fwSetModel(ent, const model[])
63 +{
64 + if (!get_pcvar_num(g_pEnabled) || !pev_valid(ent))
65 + return FMRES_IGNORED
66 +
67 + if (!equal(model, g_szHeModel))
68 + return FMRES_IGNORED
69 +
70 + /* it is a live HE grenade: dress it as a chicken */
71 + engfunc(EngFunc_SetModel, ent, g_szChickenModel)
72 +
73 + new Float:fDmgTime
74 + pev(ent, pev_dmgtime, fDmgTime)
75 +
76 + new Float:delay = fDmgTime - get_gametime() - 0.1
77 +
78 + if (delay < 0.2)
79 + delay = 0.2
80 +
81 + set_task(delay, "taskHatch", ent)
82 + return FMRES_IGNORED
83 +}
84 +
85 +public taskHatch(ent)
86 +{
87 + if (!pev_valid(ent))
88 + return
89 +
90 + static Float:fOrigin[3]
91 + pev(ent, pev_origin, fOrigin)
92 +
93 + new owner = pev(ent, pev_owner)
94 + new count = get_pcvar_num(g_pCount)
95 +
96 + for (new i = 0; i < count; i++)
97 + spawnChick(fOrigin, owner)
98 +}
99 +
100 +spawnChick(const Float:origin[3], owner)
101 +{
102 + new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
103 +
104 + if (!pev_valid(ent))
105 + return
106 +
107 + set_pev(ent, pev_classname, CHICK_CLASS)
108 + engfunc(EngFunc_SetModel, ent, g_szChickenModel)
109 +
110 + set_pev(ent, pev_movetype, MOVETYPE_TOSS)
111 + set_pev(ent, pev_solid, SOLID_TRIGGER)
112 + set_pev(ent, pev_owner, owner)
113 +
114 + static Float:mins[3], Float:maxs[3]
115 + mins[0] = -4.0; mins[1] = -4.0; mins[2] = 0.0
116 + maxs[0] = 4.0; maxs[1] = 4.0; maxs[2] = 8.0
117 + engfunc(EngFunc_SetSize, ent, mins, maxs)
118 + engfunc(EngFunc_SetOrigin, ent, origin)
119 +
120 + /* random scatter velocity */
121 + static Float:vel[3]
122 + vel[0] = float(random_num(-180, 180))
123 + vel[1] = float(random_num(-180, 180))
124 + vel[2] = float(random_num(180, 320))
125 + set_pev(ent, pev_velocity, vel)
126 +
127 + /* hatch-to-pop delay via Think */
128 + new Float:life = random_float(0.7, 1.5)
129 + set_pev(ent, pev_nextthink, get_gametime() + life)
130 +}
131 +
132 +public fwThink(ent)
133 +{
134 + if (!pev_valid(ent))
135 + return FMRES_IGNORED
136 +
137 + static cls[32]
138 + pev(ent, pev_classname, cls, charsmax(cls))
139 +
140 + if (!equal(cls, CHICK_CLASS))
141 + return FMRES_IGNORED
142 +
143 + static Float:origin[3]
144 + pev(ent, pev_origin, origin)
145 +
146 + new owner = pev(ent, pev_owner)
147 +
148 + /* visual explosion */
149 + message_begin_f(MSG_PVS, SVC_TEMPENTITY, origin)
150 + write_byte(TE_EXPLOSION)
151 + write_coord(floatround(origin[0]))
152 + write_coord(floatround(origin[1]))
153 + write_coord(floatround(origin[2]))
154 + write_short(g_iSprExplode)
155 + write_byte(12)
156 + write_byte(20)
157 + write_byte(0)
158 + message_end()
159 +
160 + emit_sound(ent, CHAN_STATIC, g_szCluckSound, 1.0, ATTN_NORM, 0, PITCH_NORM)
161 +
162 + blastDamage(origin, owner)
163 +
164 + engfunc(EngFunc_RemoveEntity, ent)
165 + return FMRES_IGNORED
166 +}
167 +
168 +blastDamage(const Float:origin[3], owner)
169 +{
170 + new Float:radius = get_pcvar_float(g_pRadius)
171 + new Float:maxDmg = get_pcvar_float(g_pDamage)
172 + new attacker = (owner >= 1 && owner <= g_iMaxPlayers) ? owner : 0
173 +
174 + for (new i = 1; i <= g_iMaxPlayers; i++)
175 + {
176 + if (!is_user_alive(i))
177 + continue
178 +
179 + static Float:pOrigin[3]
180 + pev(i, pev_origin, pOrigin)
181 +
182 + new Float:dist = get_distance_f(origin, pOrigin)
183 +
184 + if (dist > radius)
185 + continue
186 +
187 + new Float:scale = 1.0 - (dist / radius)
188 + new Float:dmg = maxDmg * scale
189 +
190 + if (dmg < 1.0)
191 + continue
192 +
193 + new inflictor = (attacker > 0) ? attacker : i
194 + ExecuteHamB(Ham_TakeDamage, i, inflictor, attacker > 0 ? attacker : i, dmg, DMG_BLAST)
195 + }
196 +}
+46 -0 csb.json A
@@ -0,0 +1,46 @@
1 +{
2 + "name": "CSB Chicken Grenade",
3 + "category": "fun",
4 + "tags": "chicken, grenade, fun",
5 + "image": "",
6 + "original_author": "Chicken Mod (concept)",
7 + "original_url": "",
8 + "license": "GPL-3.0",
9 + "title": "CSB Chicken Grenade",
10 + "short_desc": "HE grenades wear a chicken model and hatch several chickens that scatter and pop with blast damage.",
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": "fakemeta,hamsandwich,fun",
20 + "install_notes": "1. Enable fakemeta, hamsandwich and fun in addons/amxmodx/configs/modules.ini\n2. Provide a chicken model at models/chick.mdl (or edit the path)\n3. Put csb_chicken_grenade.amxx in addons/amxmodx/plugins/ and add it to plugins.ini\n4. Change map",
21 + "known_conflicts": "Other plugins that replace the HE grenade model or hook grenade explosions can conflict.",
22 + "cvars": [
23 + {
24 + "name": "csb_chick_enabled",
25 + "default": "1",
26 + "description": "Enable or disable chicken grenades."
27 + },
28 + {
29 + "name": "csb_chick_count",
30 + "default": "5",
31 + "description": "Number of chickens hatched per grenade."
32 + },
33 + {
34 + "name": "csb_chick_damage",
35 + "default": "50",
36 + "description": "Peak blast damage per chicken."
37 + },
38 + {
39 + "name": "csb_chick_radius",
40 + "default": "140",
41 + "description": "Blast radius per chicken."
42 + }
43 + ],
44 + "commands": [],
45 + "main": "addons/amxmodx/scripting/csb_chicken_grenade.sma"
46 +}
0 47