Promoveaza serverul

Initial release 1.0.0

Browse Source
1.0.0 - Initial release.
Daemon666 committed commit 442ad78a4c6f7de78e269fe2cc45486f4e7d0687
4 changed files with 149 additions and 0 deletions
+3 -0 CHANGELOG.md A
@@ -0,0 +1,3 @@
1 +## 1.0.0 (2025-05-23)
2 +
3 +1.0.0 - Initial release.
+1 -0 README.md A
@@ -0,0 +1 @@
1 +<p><strong>CSB Push Teammates</strong> is the opposite of semiclip: body collision stays on, but when two living teammates overlap, a small velocity is applied every frame to push them apart. The closer the overlap, the harder the push, so a deliberate blocker is slid off a doorway or ladder without making normal stacking or boosting feel wrong.</p><h2>Features</h2><ul><li>Per-frame push via <code>FM_StartFrame</code>, proportional to overlap depth.</li><li>Push radius and strength are cvar driven.</li><li>No client-side changes required.</li></ul><h2>Installation</h2><ol><li>Enable the <code>fakemeta</code> module in <code>addons/amxmodx/configs/modules.ini</code>.</li><li>Compile <code>csb_push_teammates.sma</code>, copy the .amxx to <code>addons/amxmodx/plugins/</code> and add it to <code>plugins.ini</code>.</li><li>Change map.</li></ol>
+104 -0 addons/amxmodx/scripting/csb_push_teammates.sma A
@@ -0,0 +1,104 @@
1 +/*
2 + * CSB Push Teammates
3 + * Copyright (C) 2026 counter-strike-boost.com
4 + *
5 + * The opposite of semiclip: when two living teammates overlap, a small
6 + * velocity is applied every frame to push them gently apart. This stops
7 + * deliberate door/ladder blocking on servers that do not want full semiclip,
8 + * while keeping normal body collision everywhere else.
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 <fakemeta>
20 +
21 +new const PLUGIN[] = "CSB Push Teammates"
22 +new const VERSION[] = "1.0.0"
23 +new const AUTHOR[] = "counter-strike-boost.com"
24 +
25 +new g_pEnabled, g_pForce, g_pRadius
26 +
27 +public plugin_init()
28 +{
29 + register_plugin(PLUGIN, VERSION, AUTHOR)
30 +
31 + g_pEnabled = register_cvar("csb_push_enabled", "1")
32 + g_pForce = register_cvar("csb_push_force", "55.0")
33 + g_pRadius = register_cvar("csb_push_radius", "42.0")
34 +
35 + register_forward(FM_StartFrame, "fwStartFrame", 0)
36 +}
37 +
38 +public fwStartFrame()
39 +{
40 + if (!get_pcvar_num(g_pEnabled))
41 + return FMRES_IGNORED
42 +
43 + static players[32], num
44 + get_players(players, num, "a")
45 +
46 + if (num < 2)
47 + return FMRES_IGNORED
48 +
49 + static Float:radius, Float:force
50 + radius = get_pcvar_float(g_pRadius)
51 + force = get_pcvar_float(g_pForce)
52 +
53 + for (new i = 0; i < num; i++)
54 + {
55 + new id = players[i]
56 + new team = get_user_team(id)
57 +
58 + if (team != 1 && team != 2)
59 + continue
60 +
61 + static Float:orig[3]
62 + pev(id, pev_origin, orig)
63 +
64 + for (new j = i + 1; j < num; j++)
65 + {
66 + new other = players[j]
67 +
68 + if (get_user_team(other) != team)
69 + continue
70 +
71 + static Float:orig2[3]
72 + pev(other, pev_origin, orig2)
73 +
74 + static Float:dx, Float:dy, Float:dist
75 + dx = orig[0] - orig2[0]
76 + dy = orig[1] - orig2[1]
77 + dist = floatsqroot(dx * dx + dy * dy)
78 +
79 + if (dist >= radius || dist < 1.0)
80 + continue
81 +
82 + /* normalised direction from other -> id */
83 + static Float:nx, Float:ny, Float:push
84 + nx = dx / dist
85 + ny = dy / dist
86 + /* the deeper the overlap, the harder the push */
87 + push = force * (1.0 - dist / radius)
88 +
89 + static Float:vel[3]
90 +
91 + pev(id, pev_velocity, vel)
92 + vel[0] += nx * push
93 + vel[1] += ny * push
94 + set_pev(id, pev_velocity, vel)
95 +
96 + pev(other, pev_velocity, vel)
97 + vel[0] -= nx * push
98 + vel[1] -= ny * push
99 + set_pev(other, pev_velocity, vel)
100 + }
101 + }
102 +
103 + return FMRES_IGNORED
104 +}
+41 -0 csb.json A
@@ -0,0 +1,41 @@
1 +{
2 + "name": "CSB Push Teammates",
3 + "category": "movement",
4 + "tags": "push, block, teammates",
5 + "image": "",
6 + "original_author": "",
7 + "original_url": "",
8 + "license": "GPL-3.0",
9 + "title": "CSB Push Teammates",
10 + "short_desc": "Gently pushes overlapping teammates apart every frame, stopping door and ladder blocking without full semiclip.",
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. Compile the .sma (or use the site compiler)\n2. Put the .amxx in addons/amxmodx/plugins/\n3. Add it to addons/amxmodx/configs/plugins.ini\n4. Change map",
21 + "known_conflicts": "Do not run together with a semiclip plugin; pick one collision policy.",
22 + "cvars": [
23 + {
24 + "name": "csb_push_enabled",
25 + "default": "1",
26 + "description": "Enable the teammate push."
27 + },
28 + {
29 + "name": "csb_push_force",
30 + "default": "55.0",
31 + "description": "Maximum push velocity applied at full overlap."
32 + },
33 + {
34 + "name": "csb_push_radius",
35 + "default": "42.0",
36 + "description": "Distance in units under which teammates are pushed apart."
37 + }
38 + ],
39 + "commands": [],
40 + "main": "addons/amxmodx/scripting/csb_push_teammates.sma"
41 +}
0 42