Promuj serwer

Initial release 1.0.0

Browse Source
1.0.0 - Initial release.
Daemon666 committed commit a1ef56c3be89d31c57cc8521870bfaa1dc8cc32f
4 changed files with 250 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 Parachute</strong> lets players float down safely: hold <code>+use</code> while falling and the plugin clamps your downward velocity in <code>PlayerPreThink</code> and shows a parachute model attached above you (<code>pev_aiment</code> with <code>MOVETYPE_FOLLOW</code>). Let go of <code>+use</code> or touch the ground and the parachute disappears instantly.</p><h2>Features</h2><ul><li>Smooth, configurable fall speed (<code>csb_para_fallspeed</code>).</li><li>Optional VIP gate: set <code>csb_para_vipflag</code> to an admin flag to restrict it.</li><li>Per-round use limit (<code>csb_para_maxperround</code>, 0 = unlimited).</li><li>Parachute model precached at map start; if the model is missing the fall is still slowed, just without a visible chute.</li><li>Cleaned up on landing, death, respawn, round start and disconnect - no stray entities.</li></ul><h2>Model</h2><p>Put a parachute model at <code>cstrike/models/csb_parachute.mdl</code> and add it to your fastdl. Any standard parachute <code>.mdl</code> works; the plugin sets sequence 0 and lets the model animate.</p><h2>Installation</h2><ol><li>Enable the <code>fakemeta</code> module in <code>modules.ini</code> (default on).</li><li>Compile, copy <code>csb_parachute.amxx</code> into <code>plugins/</code>, add it to <code>plugins.ini</code>.</li><li>Upload the model and change the map. Jump from a height and hold <code>+use</code>.</li></ol><p>Inspired by the well-known &quot;Parachute&quot; plugin by KRoTaL and later VEN; independent GPL re-implementation.</p>
+194 -0 addons/amxmodx/scripting/csb_parachute.sma A
@@ -0,0 +1,194 @@
1 +/*
2 + * CSB Parachute
3 + * Copyright (C) 2026 counter-strike-boost.com
4 + *
5 + * Hold +use while falling to deploy a parachute. In PlayerPreThink the plugin
6 + * clamps the downward velocity to a configurable speed and shows a parachute
7 + * model attached above the player (pev_aiment / MOVETYPE_FOLLOW); it is removed
8 + * the moment the player lands or lets go of +use. Cvars control the fall speed,
9 + * a VIP-only flag and a per-round use limit.
10 + *
11 + * Inspired by the well-known "Parachute" plugin by KRoTaL and later VEN. This is
12 + * an independent GPL re-implementation; no original code is reused.
13 + *
14 + * This program is free software: you can redistribute it and/or modify it under
15 + * the terms of the GNU General Public License as published by the Free Software
16 + * Foundation, either version 3 of the License, or (at your option) any later
17 + * version. It is distributed in the hope that it will be useful, but WITHOUT ANY
18 + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
19 + * A PARTICULAR PURPOSE. See <https://www.gnu.org/licenses/> for details.
20 + */
21 +
22 +#include <amxmodx>
23 +#include <fakemeta>
24 +
25 +new const PLUGIN[] = "CSB Parachute"
26 +new const VERSION[] = "1.0.0"
27 +new const AUTHOR[] = "counter-strike-boost.com"
28 +
29 +#define PARA_MODEL "models/csb_parachute.mdl"
30 +
31 +new g_iChute[33]
32 +new g_iUsed[33]
33 +new bool:g_bModelOk
34 +
35 +new g_pEnabled, g_pFallSpeed, g_pVipFlag, g_pMaxPerRound
36 +
37 +public plugin_init()
38 +{
39 + register_plugin(PLUGIN, VERSION, AUTHOR)
40 +
41 + g_pEnabled = register_cvar("csb_para_enabled", "1")
42 + g_pFallSpeed = register_cvar("csb_para_fallspeed", "100")
43 + g_pVipFlag = register_cvar("csb_para_vipflag", "")
44 + g_pMaxPerRound = register_cvar("csb_para_maxperround", "0") /* 0 = unlimited */
45 +
46 + register_forward(FM_PlayerPreThink, "fwPreThink")
47 +
48 + register_event("ResetHUD", "evSpawn", "b")
49 + register_event("HLTV", "evNewRound", "a", "1=0", "2=0")
50 +}
51 +
52 +public plugin_precache()
53 +{
54 + if (file_exists(PARA_MODEL))
55 + {
56 + precache_model(PARA_MODEL)
57 + g_bModelOk = true
58 + }
59 + else
60 + {
61 + log_amx("[CSB Parachute] %s not found - the parachute will slow the fall but show no model.", PARA_MODEL)
62 + }
63 +}
64 +
65 +public client_putinserver(id)
66 +{
67 + g_iChute[id] = 0
68 + g_iUsed[id] = 0
69 +}
70 +
71 +public client_disconnected(id)
72 +{
73 + removeChute(id)
74 + g_iChute[id] = 0
75 +}
76 +
77 +public evSpawn(id)
78 +{
79 + removeChute(id)
80 + g_iUsed[id] = 0
81 +}
82 +
83 +public evNewRound()
84 +{
85 + for (new i = 1; i <= 32; i++)
86 + g_iUsed[i] = 0
87 +}
88 +
89 +vipAllowed(id)
90 +{
91 + new flagStr[8]
92 + get_pcvar_string(g_pVipFlag, flagStr, charsmax(flagStr))
93 +
94 + if (!flagStr[0])
95 + return 1
96 +
97 + new need = read_flags(flagStr)
98 +
99 + return (get_user_flags(id) & need) ? 1 : 0
100 +}
101 +
102 +public fwPreThink(id)
103 +{
104 + if (!get_pcvar_num(g_pEnabled) || !is_user_alive(id))
105 + {
106 + if (g_iChute[id])
107 + removeChute(id)
108 + return
109 + }
110 +
111 + new flags = pev(id, pev_flags)
112 +
113 + if (flags & FL_ONGROUND)
114 + {
115 + if (g_iChute[id])
116 + removeChute(id)
117 + return
118 + }
119 +
120 + new Float:vel[3]
121 + pev(id, pev_velocity, vel)
122 +
123 + new button = pev(id, pev_button)
124 +
125 + /* deploy only while +use is held and the player is actually descending */
126 + if ((button & IN_USE) && vel[2] < 0.0 && vipAllowed(id))
127 + {
128 + new maxUse = get_pcvar_num(g_pMaxPerRound)
129 +
130 + if (!g_iChute[id])
131 + {
132 + if (maxUse > 0 && g_iUsed[id] >= maxUse)
133 + return
134 +
135 + deployChute(id)
136 + g_iUsed[id]++
137 + }
138 +
139 + new Float:fall = get_pcvar_float(g_pFallSpeed)
140 +
141 + if (fall < 10.0)
142 + fall = 10.0
143 +
144 + vel[2] = -fall
145 + set_pev(id, pev_velocity, vel)
146 + }
147 + else if (g_iChute[id])
148 + {
149 + removeChute(id)
150 + }
151 +}
152 +
153 +deployChute(id)
154 +{
155 + if (!g_bModelOk)
156 + {
157 + g_iChute[id] = -1 /* marker: active but no visible model */
158 + return
159 + }
160 +
161 + new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
162 +
163 + if (!pev_valid(ent))
164 + {
165 + g_iChute[id] = -1
166 + return
167 + }
168 +
169 + engfunc(EngFunc_SetModel, ent, PARA_MODEL)
170 +
171 + set_pev(ent, pev_movetype, MOVETYPE_FOLLOW)
172 + set_pev(ent, pev_aiment, id)
173 + set_pev(ent, pev_owner, id)
174 + set_pev(ent, pev_sequence, 0)
175 + set_pev(ent, pev_frame, 0.0)
176 + set_pev(ent, pev_framerate, 1.0)
177 + set_pev(ent, pev_animtime, get_gametime())
178 +
179 + new Float:origin[3]
180 + pev(id, pev_origin, origin)
181 + set_pev(ent, pev_origin, origin)
182 +
183 + g_iChute[id] = ent
184 +}
185 +
186 +removeChute(id)
187 +{
188 + new ent = g_iChute[id]
189 +
190 + if (ent > 0 && pev_valid(ent))
191 + engfunc(EngFunc_RemoveEntity, ent)
192 +
193 + g_iChute[id] = 0
194 +}
+52 -0 csb.json A
@@ -0,0 +1,52 @@
1 +{
2 + "name": "CSB Parachute",
3 + "category": "fun",
4 + "tags": "parachute, fall, fun",
5 + "image": "",
6 + "original_author": "KRoTaL / VEN (Parachute)",
7 + "original_url": "",
8 + "license": "GPL-3.0",
9 + "title": "CSB Parachute",
10 + "short_desc": "Hold +use while falling to deploy a parachute that clamps your fall speed and shows a model above you, with fall-speed, VIP-only and per-round-limit cvars.",
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",
20 + "install_notes": "1. Ensure the fakemeta module is enabled in modules.ini\n2. Put csb_parachute.amxx in addons/amxmodx/plugins/ and add it to plugins.ini\n3. Upload cstrike/models/csb_parachute.mdl and add it to fastdl\n4. Change map",
21 + "known_conflicts": "Other parachute or fall-damage/slow-fall plugins may conflict on velocity - run only one.",
22 + "cvars": [
23 + {
24 + "name": "csb_para_enabled",
25 + "default": "1",
26 + "description": "Enable or disable the parachute."
27 + },
28 + {
29 + "name": "csb_para_fallspeed",
30 + "default": "100",
31 + "description": "Downward speed (units/s) while the parachute is open."
32 + },
33 + {
34 + "name": "csb_para_vipflag",
35 + "default": "",
36 + "description": "Admin flag required to use the parachute (empty = everyone)."
37 + },
38 + {
39 + "name": "csb_para_maxperround",
40 + "default": "0",
41 + "description": "Maximum parachute deploys per round (0 = unlimited)."
42 + }
43 + ],
44 + "commands": [
45 + {
46 + "name": "+use",
47 + "access": "",
48 + "description": "Hold while falling to deploy the parachute."
49 + }
50 + ],
51 + "main": "addons/amxmodx/scripting/csb_parachute.sma"
52 +}
0 53