Initial release 1.0.0
Browse Source1.0.0 - Initial release.
4 changed files
with 148 additions and 0 deletions
A
CHANGELOG.md
+3 -0
A
README.md
+1 -0
A
addons/amxmodx/scripting/csb_team_gravity.sma
+97 -0
A
csb.json
+47 -0
CHANGELOG.md
A
| @@ -0,0 +1,3 @@ | ||
| 1 | +## 1.0.0 (2025-07-13) | |
| 2 | + | |
| 3 | +1.0.0 - Initial release. |
README.md
A
| @@ -0,0 +1 @@ | ||
| 1 | +<p><strong>CSB Team Gravity</strong> lets one side jump higher or fall slower than the other — the balance trick behind Furien, Hide'n'Seek and many custom modes. On every respawn the plugin reads the player's team and applies <code>set_user_gravity</code> with the team's multiplier (<code>1.0</code> is normal gravity, <code>0.5</code> is half). When you turn the plugin off, everyone is reset to normal on their next spawn.</p><h2>Features</h2><ul><li>Separate gravity multipliers for T (<code>csb_grav_t</code>) and CT (<code>csb_grav_ct</code>).</li><li>Re-applied on every spawn via the <code>ResetHUD</code> event.</li><li><code>say /gravity</code> tells a player their current multiplier.</li><li>Disabling the plugin restores normal gravity.</li></ul><h2>Installation</h2><ol><li>Enable the <code>fun</code> module in <code>modules.ini</code>.</li><li>Compile <code>csb_team_gravity.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> |
addons/amxmodx/scripting/csb_team_gravity.sma
A
| @@ -0,0 +1,97 @@ | ||
| 1 | +/* | |
| 2 | + * CSB Team Gravity | |
| 3 | + * Copyright (C) 2026 counter-strike-boost.com | |
| 4 | + * | |
| 5 | + * Applies a per-team gravity multiplier with set_user_gravity on every spawn, | |
| 6 | + * used by mods like Furien or Hide'n'Seek where one side should jump higher or | |
| 7 | + * fall slower than the other. The values are cvars (1.0 = normal), and when the | |
| 8 | + * plugin is disabled every player's gravity is reset to normal. | |
| 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 <fun> | |
| 20 | + | |
| 21 | +new const PLUGIN[] = "CSB Team Gravity" | |
| 22 | +new const VERSION[] = "1.0.0" | |
| 23 | +new const AUTHOR[] = "counter-strike-boost.com" | |
| 24 | + | |
| 25 | +new g_pEnabled, g_pT, g_pCT | |
| 26 | + | |
| 27 | +public plugin_init() | |
| 28 | +{ | |
| 29 | + register_plugin(PLUGIN, VERSION, AUTHOR) | |
| 30 | + | |
| 31 | + g_pEnabled = register_cvar("csb_grav_enabled", "1") | |
| 32 | + g_pT = register_cvar("csb_grav_t", "1.0") | |
| 33 | + g_pCT = register_cvar("csb_grav_ct", "1.0") | |
| 34 | + | |
| 35 | + /* ResetHUD fires on every (re)spawn */ | |
| 36 | + register_event("ResetHUD", "onSpawn", "b") | |
| 37 | + | |
| 38 | + register_clcmd("say /gravity", "cmdInfo") | |
| 39 | + register_clcmd("say_team /gravity", "cmdInfo") | |
| 40 | +} | |
| 41 | + | |
| 42 | +public onSpawn(id) | |
| 43 | +{ | |
| 44 | + if (!is_user_alive(id)) | |
| 45 | + return | |
| 46 | + | |
| 47 | + /* small delay so team is fully assigned before we read it */ | |
| 48 | + set_task(0.1, "taskApply", id) | |
| 49 | +} | |
| 50 | + | |
| 51 | +public taskApply(id) | |
| 52 | +{ | |
| 53 | + if (is_user_alive(id)) | |
| 54 | + applyGravity(id) | |
| 55 | +} | |
| 56 | + | |
| 57 | +applyGravity(id) | |
| 58 | +{ | |
| 59 | + if (!get_pcvar_num(g_pEnabled)) | |
| 60 | + { | |
| 61 | + set_user_gravity(id, 1.0) | |
| 62 | + return | |
| 63 | + } | |
| 64 | + | |
| 65 | + new Float:g = 1.0 | |
| 66 | + new team = get_user_team(id) | |
| 67 | + | |
| 68 | + if (team == 1) | |
| 69 | + g = get_pcvar_float(g_pT) | |
| 70 | + else if (team == 2) | |
| 71 | + g = get_pcvar_float(g_pCT) | |
| 72 | + | |
| 73 | + if (g <= 0.0) | |
| 74 | + g = 1.0 | |
| 75 | + | |
| 76 | + set_user_gravity(id, g) | |
| 77 | +} | |
| 78 | + | |
| 79 | +public cmdInfo(id) | |
| 80 | +{ | |
| 81 | + if (!get_pcvar_num(g_pEnabled)) | |
| 82 | + { | |
| 83 | + client_print(id, print_chat, "[CSB] Team gravity is disabled (normal for everyone).") | |
| 84 | + return PLUGIN_HANDLED | |
| 85 | + } | |
| 86 | + | |
| 87 | + new Float:mine = 1.0 | |
| 88 | + new team = get_user_team(id) | |
| 89 | + | |
| 90 | + if (team == 1) | |
| 91 | + mine = get_pcvar_float(g_pT) | |
| 92 | + else if (team == 2) | |
| 93 | + mine = get_pcvar_float(g_pCT) | |
| 94 | + | |
| 95 | + client_print(id, print_chat, "[CSB] Your gravity multiplier: %.2f (1.00 = normal).", mine) | |
| 96 | + return PLUGIN_HANDLED | |
| 97 | +} |
csb.json
A
| @@ -0,0 +1,47 @@ | ||
| 1 | +{ | |
| 2 | + "name": "CSB Team Gravity", | |
| 3 | + "category": "movement", | |
| 4 | + "tags": "gravity, teams, balance", | |
| 5 | + "image": "", | |
| 6 | + "original_author": "", | |
| 7 | + "original_url": "", | |
| 8 | + "license": "GPL-3.0", | |
| 9 | + "title": "CSB Team Gravity", | |
| 10 | + "short_desc": "Per-team gravity multipliers applied on every spawn with set_user_gravity; reset to normal when disabled.", | |
| 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": "fun", | |
| 20 | + "install_notes": "1. Enable the fun module in addons/amxmodx/configs/modules.ini\n2. Put csb_team_gravity.amxx in addons/amxmodx/plugins/ and add it to plugins.ini\n3. Change map", | |
| 21 | + "known_conflicts": "Other plugins that call set_user_gravity (low-gravity rounds, VIP perks) will override the team value on that player.", | |
| 22 | + "cvars": [ | |
| 23 | + { | |
| 24 | + "name": "csb_grav_enabled", | |
| 25 | + "default": "1", | |
| 26 | + "description": "Enable per-team gravity (0 resets everyone to normal)." | |
| 27 | + }, | |
| 28 | + { | |
| 29 | + "name": "csb_grav_t", | |
| 30 | + "default": "1.0", | |
| 31 | + "description": "Gravity multiplier for Terrorists (1.0 = normal)." | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "name": "csb_grav_ct", | |
| 35 | + "default": "1.0", | |
| 36 | + "description": "Gravity multiplier for Counter-Terrorists (1.0 = normal)." | |
| 37 | + } | |
| 38 | + ], | |
| 39 | + "commands": [ | |
| 40 | + { | |
| 41 | + "name": "say /gravity", | |
| 42 | + "access": "", | |
| 43 | + "description": "Show your current gravity multiplier." | |
| 44 | + } | |
| 45 | + ], | |
| 46 | + "main": "addons/amxmodx/scripting/csb_team_gravity.sma" | |
| 47 | +} | |
| 0 | 48 |









