Initial release 1.0.0
Browse Source1.0.0 - Initial release.
4 changed files
with 135 additions and 0 deletions
A
CHANGELOG.md
+3 -0
A
README.md
+1 -0
A
addons/amxmodx/scripting/csb_team_flash_off.sma
+95 -0
A
csb.json
+36 -0
CHANGELOG.md
A
| @@ -0,0 +1,3 @@ | ||
| 1 | +## 1.0.0 (2025-12-17) | |
| 2 | + | |
| 3 | +1.0.0 - Initial release. |
README.md
A
| @@ -0,0 +1 @@ | ||
| 1 | +<p><strong>CSB No Team Flash</strong> ends teamflashing. When a flashbang detonates the plugin captures the thrower from the grenade entity's owner (via the detonation sound), then intercepts the flash <code>ScreenFade</code> sent to each affected player: if the player is on the thrower's team the fade is blocked, and a cvar decides whether the thrower flashes themselves. Enemies are still blinded normally.</p><p>Inspired by No Team Flash by VEN. Independent GPL re-implementation.</p><h2>Features</h2><ul><li>Blocks flash for teammates of the thrower.</li><li>Optional self-flash via <code>csb_noflash_selfflash</code>.</li><li>Enemies are still fully flashed.</li><li>Lightweight — one forward and one message hook.</li></ul><h2>Installation</h2><ol><li>Enable the <code>fakemeta</code> module in <code>modules.ini</code>.</li><li>Compile <code>csb_team_flash_off.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_flash_off.sma
A
| @@ -0,0 +1,95 @@ | ||
| 1 | +/* | |
| 2 | + * CSB No Team Flash | |
| 3 | + * Copyright (C) 2026 counter-strike-boost.com | |
| 4 | + * | |
| 5 | + * Stops flashbangs from blinding teammates. When a flashbang detonates the plugin | |
| 6 | + * captures the thrower from the grenade entity's owner (via the detonation | |
| 7 | + * sound), then intercepts the flash ScreenFade sent to each affected player: if | |
| 8 | + * the player is on the thrower's team (and, by cvar, if it is the thrower | |
| 9 | + * themselves) the fade is blocked. Enemies are still blinded normally. | |
| 10 | + * | |
| 11 | + * Inspired by No Team Flash by VEN. Independent GPL re-implementation. | |
| 12 | + * | |
| 13 | + * This program is free software: you can redistribute it and/or modify it under | |
| 14 | + * the terms of the GNU General Public License as published by the Free Software | |
| 15 | + * Foundation, either version 3 of the License, or (at your option) any later | |
| 16 | + * version. It is distributed in the hope that it will be useful, but WITHOUT | |
| 17 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | |
| 18 | + * FOR A PARTICULAR PURPOSE. See <https://www.gnu.org/licenses/> for details. | |
| 19 | + */ | |
| 20 | + | |
| 21 | +#include <amxmodx> | |
| 22 | +#include <fakemeta> | |
| 23 | + | |
| 24 | +new const PLUGIN[] = "CSB No Team Flash" | |
| 25 | +new const VERSION[] = "1.0.0" | |
| 26 | +new const AUTHOR[] = "counter-strike-boost.com" | |
| 27 | + | |
| 28 | +new g_pEnabled, g_pSelfFlash | |
| 29 | + | |
| 30 | +new g_iLastThrower | |
| 31 | +new g_iLastThrowerTeam | |
| 32 | +new Float:g_fLastFlash | |
| 33 | + | |
| 34 | +public plugin_init() | |
| 35 | +{ | |
| 36 | + register_plugin(PLUGIN, VERSION, AUTHOR) | |
| 37 | + | |
| 38 | + g_pEnabled = register_cvar("csb_noflash_enabled", "1") | |
| 39 | + g_pSelfFlash = register_cvar("csb_noflash_selfflash", "0") | |
| 40 | + | |
| 41 | + register_forward(FM_EmitSound, "fwEmitSound") | |
| 42 | + register_message(get_user_msgid("ScreenFade"), "msgScreenFade") | |
| 43 | +} | |
| 44 | + | |
| 45 | +/* a flashbang detonation plays weapons/flashbang-N.wav from the grenade entity */ | |
| 46 | +public fwEmitSound(ent, channel, const sample[], Float:volume, Float:attenuation, flags, pitch) | |
| 47 | +{ | |
| 48 | + if (!get_pcvar_num(g_pEnabled)) | |
| 49 | + return FMRES_IGNORED | |
| 50 | + | |
| 51 | + if (containi(sample, "flashbang") == -1) | |
| 52 | + return FMRES_IGNORED | |
| 53 | + | |
| 54 | + if (!pev_valid(ent)) | |
| 55 | + return FMRES_IGNORED | |
| 56 | + | |
| 57 | + new owner = pev(ent, pev_owner) | |
| 58 | + | |
| 59 | + if (owner >= 1 && owner <= 32) | |
| 60 | + { | |
| 61 | + g_iLastThrower = owner | |
| 62 | + g_iLastThrowerTeam = get_user_team(owner) | |
| 63 | + g_fLastFlash = get_gametime() | |
| 64 | + } | |
| 65 | + | |
| 66 | + return FMRES_IGNORED | |
| 67 | +} | |
| 68 | + | |
| 69 | +public msgScreenFade(msgid, dest, receiver) | |
| 70 | +{ | |
| 71 | + if (!get_pcvar_num(g_pEnabled)) | |
| 72 | + return PLUGIN_CONTINUE | |
| 73 | + | |
| 74 | + if (receiver < 1 || receiver > 32) | |
| 75 | + return PLUGIN_CONTINUE | |
| 76 | + | |
| 77 | + /* only act on a fresh flash detonation */ | |
| 78 | + if (get_gametime() - g_fLastFlash > 0.3 || g_iLastThrower == 0) | |
| 79 | + return PLUGIN_CONTINUE | |
| 80 | + | |
| 81 | + /* the thrower themselves */ | |
| 82 | + if (receiver == g_iLastThrower) | |
| 83 | + { | |
| 84 | + if (!get_pcvar_num(g_pSelfFlash)) | |
| 85 | + return PLUGIN_HANDLED | |
| 86 | + | |
| 87 | + return PLUGIN_CONTINUE | |
| 88 | + } | |
| 89 | + | |
| 90 | + /* a teammate of the thrower */ | |
| 91 | + if (get_user_team(receiver) == g_iLastThrowerTeam) | |
| 92 | + return PLUGIN_HANDLED | |
| 93 | + | |
| 94 | + return PLUGIN_CONTINUE | |
| 95 | +} |
csb.json
A
| @@ -0,0 +1,36 @@ | ||
| 1 | +{ | |
| 2 | + "name": "CSB No Team Flash", | |
| 3 | + "category": "gameplay", | |
| 4 | + "tags": "flash, team, grenade", | |
| 5 | + "image": "", | |
| 6 | + "original_author": "VEN", | |
| 7 | + "original_url": "", | |
| 8 | + "license": "GPL-3.0", | |
| 9 | + "title": "CSB No Team Flash", | |
| 10 | + "short_desc": "Stops flashbangs from blinding teammates by blocking the flash ScreenFade when the thrower is on the victim's team, with an optional self-flash toggle.", | |
| 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. Enable the fakemeta module in addons/amxmodx/configs/modules.ini\n2. Put csb_team_flash_off.amxx in addons/amxmodx/plugins/ and add it to plugins.ini\n3. Change map", | |
| 21 | + "known_conflicts": "Other plugins that hook the ScreenFade message can interfere with the flash block.", | |
| 22 | + "cvars": [ | |
| 23 | + { | |
| 24 | + "name": "csb_noflash_enabled", | |
| 25 | + "default": "1", | |
| 26 | + "description": "Enable or disable no team flash." | |
| 27 | + }, | |
| 28 | + { | |
| 29 | + "name": "csb_noflash_selfflash", | |
| 30 | + "default": "0", | |
| 31 | + "description": "Allow the thrower to flash themselves." | |
| 32 | + } | |
| 33 | + ], | |
| 34 | + "commands": [], | |
| 35 | + "main": "addons/amxmodx/scripting/csb_team_flash_off.sma" | |
| 36 | +} | |
| 0 | 37 |









