Initial release 1.0.0
Browse Source1.0.0 - Initial release.
4 changed files
with 204 additions and 0 deletions
A
CHANGELOG.md
+3 -0
A
README.md
+1 -0
A
addons/amxmodx/scripting/csb_match_block_cmds.sma
+148 -0
A
csb.json
+52 -0
CHANGELOG.md
A
| @@ -0,0 +1,3 @@ | ||
| 1 | +## 1.0.0 (2025-09-03) | |
| 2 | + | |
| 3 | +1.0.0 - Initial release. |
README.md
A
| @@ -0,0 +1 @@ | ||
| 1 | +<p><strong>CSB Match Command Block</strong> removes the little disruptions that ruin a competitive round. Flag the match live with <code>amx_matchlive 1</code> and the plugin: rate-limits the radio, stops dead players from using team chat (anti-ghosting), blocks a short list of third-party / <code>+hook</code> style commands, and refuses <code>buy</code> commands once buy time is over. Everything is done by hooking the client commands and returning <code>PLUGIN_HANDLED</code>.</p><h2>Features</h2><ul><li>Radio rate limit (<code>csb_block_radiomax</code> per <code>csb_block_radiowin</code> seconds).</li><li>Dead players cannot use team chat during a live match.</li><li>Blocks <code>+hook</code>, <code>+lookatweapon</code>, <code>spec_menu</code>, <code>unbindall</code>.</li><li>Blocks buying after <code>mp_buytime</code> elapses.</li></ul><h2>Installation</h2><ol><li>Compile <code>csb_match_block_cmds.sma</code> and copy it to <code>addons/amxmodx/plugins/</code>.</li><li>Add it to <code>plugins.ini</code>, change the map, then <code>amx_matchlive 1</code> when the match starts.</li></ol> |
addons/amxmodx/scripting/csb_match_block_cmds.sma
A
| @@ -0,0 +1,148 @@ | ||
| 1 | +/* | |
| 2 | + * CSB Match Command Block | |
| 3 | + * Copyright (C) 2026 counter-strike-boost.com | |
| 4 | + * | |
| 5 | + * While a match is flagged live this plugin blocks disruptive client commands: | |
| 6 | + * it rate-limits the radio, stops dead players from using team chat (anti-ghost), | |
| 7 | + * blocks a small list of third-party / +hook style commands, and refuses buy | |
| 8 | + * commands once the buy time is over. Toggle the live state with amx_matchlive. | |
| 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 <amxmisc> | |
| 20 | + | |
| 21 | +new const PLUGIN[] = "CSB Match Command Block" | |
| 22 | +new const VERSION[] = "1.0.0" | |
| 23 | +new const AUTHOR[] = "counter-strike-boost.com" | |
| 24 | + | |
| 25 | +new g_pEnabled, g_pLive, g_pRadioMax, g_pRadioWin | |
| 26 | +new g_iRadio[33] | |
| 27 | +new Float:g_fRadioStart[33] | |
| 28 | +new Float:g_fRoundStart | |
| 29 | + | |
| 30 | +public plugin_init() | |
| 31 | +{ | |
| 32 | + register_plugin(PLUGIN, VERSION, AUTHOR) | |
| 33 | + | |
| 34 | + g_pEnabled = register_cvar("csb_block_enabled", "1") | |
| 35 | + g_pLive = register_cvar("csb_block_live", "0") | |
| 36 | + g_pRadioMax = register_cvar("csb_block_radiomax", "4") | |
| 37 | + g_pRadioWin = register_cvar("csb_block_radiowin", "10.0") | |
| 38 | + | |
| 39 | + register_concmd("amx_matchlive", "cmdSetLive", ADMIN_BAN, "<0|1> - toggle live command blocking") | |
| 40 | + | |
| 41 | + new const radios[][] = { "radio1", "radio2", "radio3" } | |
| 42 | + for (new i = 0; i < sizeof(radios); i++) | |
| 43 | + register_clcmd(radios[i], "cmdRadio") | |
| 44 | + | |
| 45 | + new const blocked[][] = { "+hook", "+lookatweapon", "spec_menu", "unbindall" } | |
| 46 | + for (new i = 0; i < sizeof(blocked); i++) | |
| 47 | + register_clcmd(blocked[i], "cmdBlocked") | |
| 48 | + | |
| 49 | + register_clcmd("buy", "cmdBuy") | |
| 50 | + register_clcmd("buyammo1", "cmdBuy") | |
| 51 | + register_clcmd("buyammo2", "cmdBuy") | |
| 52 | + register_clcmd("autobuy", "cmdBuy") | |
| 53 | + register_clcmd("rebuy", "cmdBuy") | |
| 54 | + | |
| 55 | + register_clcmd("say_team", "cmdSayTeam") | |
| 56 | + | |
| 57 | + register_logevent("evRoundStart", 2, "1=Round_Start") | |
| 58 | +} | |
| 59 | + | |
| 60 | +bool:blockActive() | |
| 61 | +{ | |
| 62 | + return get_pcvar_num(g_pEnabled) != 0 && get_pcvar_num(g_pLive) != 0 | |
| 63 | +} | |
| 64 | + | |
| 65 | +public cmdSetLive(id, level, cid) | |
| 66 | +{ | |
| 67 | + if (!cmd_access(id, level, cid, 1)) | |
| 68 | + return PLUGIN_HANDLED | |
| 69 | + | |
| 70 | + new arg[4] | |
| 71 | + read_argv(1, arg, charsmax(arg)) | |
| 72 | + set_pcvar_num(g_pLive, str_to_num(arg) ? 1 : 0) | |
| 73 | + | |
| 74 | + client_print(0, print_chat, "[CSB] Match command blocking is now %s.", get_pcvar_num(g_pLive) ? "ON (live)" : "OFF") | |
| 75 | + return PLUGIN_HANDLED | |
| 76 | +} | |
| 77 | + | |
| 78 | +public cmdRadio(id) | |
| 79 | +{ | |
| 80 | + if (!blockActive()) | |
| 81 | + return PLUGIN_CONTINUE | |
| 82 | + | |
| 83 | + new Float:now = get_gametime() | |
| 84 | + new Float:win = get_pcvar_float(g_pRadioWin) | |
| 85 | + | |
| 86 | + if (now - g_fRadioStart[id] > win) | |
| 87 | + { | |
| 88 | + g_fRadioStart[id] = now | |
| 89 | + g_iRadio[id] = 0 | |
| 90 | + } | |
| 91 | + | |
| 92 | + g_iRadio[id]++ | |
| 93 | + | |
| 94 | + if (g_iRadio[id] > get_pcvar_num(g_pRadioMax)) | |
| 95 | + { | |
| 96 | + client_print(id, print_chat, "[CSB] Radio is rate-limited during the match.") | |
| 97 | + return PLUGIN_HANDLED | |
| 98 | + } | |
| 99 | + | |
| 100 | + return PLUGIN_CONTINUE | |
| 101 | +} | |
| 102 | + | |
| 103 | +public cmdBlocked(id) | |
| 104 | +{ | |
| 105 | + if (!blockActive()) | |
| 106 | + return PLUGIN_CONTINUE | |
| 107 | + | |
| 108 | + client_print(id, print_chat, "[CSB] That command is disabled during a live match.") | |
| 109 | + return PLUGIN_HANDLED | |
| 110 | +} | |
| 111 | + | |
| 112 | +public cmdBuy(id) | |
| 113 | +{ | |
| 114 | + if (!blockActive()) | |
| 115 | + return PLUGIN_CONTINUE | |
| 116 | + | |
| 117 | + new Float:buytime = get_cvar_float("mp_buytime") * 60.0 | |
| 118 | + | |
| 119 | + if (get_gametime() - g_fRoundStart > buytime) | |
| 120 | + { | |
| 121 | + client_print(id, print_chat, "[CSB] Buy time is over.") | |
| 122 | + return PLUGIN_HANDLED | |
| 123 | + } | |
| 124 | + | |
| 125 | + return PLUGIN_CONTINUE | |
| 126 | +} | |
| 127 | + | |
| 128 | +public cmdSayTeam(id) | |
| 129 | +{ | |
| 130 | + if (blockActive() && is_user_connected(id) && !is_user_alive(id)) | |
| 131 | + { | |
| 132 | + client_print(id, print_chat, "[CSB] Dead players cannot use team chat during a live match.") | |
| 133 | + return PLUGIN_HANDLED | |
| 134 | + } | |
| 135 | + | |
| 136 | + return PLUGIN_CONTINUE | |
| 137 | +} | |
| 138 | + | |
| 139 | +public evRoundStart() | |
| 140 | +{ | |
| 141 | + g_fRoundStart = get_gametime() | |
| 142 | + | |
| 143 | + for (new i = 1; i <= 32; i++) | |
| 144 | + { | |
| 145 | + g_iRadio[i] = 0 | |
| 146 | + g_fRadioStart[i] = 0.0 | |
| 147 | + } | |
| 148 | +} |
csb.json
A
| @@ -0,0 +1,52 @@ | ||
| 1 | +{ | |
| 2 | + "name": "CSB Match Command Block", | |
| 3 | + "category": "match", | |
| 4 | + "tags": "block, commands, live", | |
| 5 | + "image": "", | |
| 6 | + "original_author": "", | |
| 7 | + "original_url": "", | |
| 8 | + "license": "GPL-3.0", | |
| 9 | + "title": "CSB Match Command Block", | |
| 10 | + "short_desc": "While a match is live it rate-limits radio, blocks dead-player team chat, kills +hook style commands and refuses buying after buytime.", | |
| 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": "", | |
| 20 | + "install_notes": "1. Put csb_match_block_cmds.amxx in addons/amxmodx/plugins/\n2. Add it to plugins.ini\n3. Change map\n4. amx_matchlive 1 at match start", | |
| 21 | + "known_conflicts": "Other plugins that re-broadcast say_team or manage buying may interact.", | |
| 22 | + "cvars": [ | |
| 23 | + { | |
| 24 | + "name": "csb_block_enabled", | |
| 25 | + "default": "1", | |
| 26 | + "description": "Master enable for the plugin." | |
| 27 | + }, | |
| 28 | + { | |
| 29 | + "name": "csb_block_live", | |
| 30 | + "default": "0", | |
| 31 | + "description": "1 while the match is live (set by amx_matchlive)." | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "name": "csb_block_radiomax", | |
| 35 | + "default": "4", | |
| 36 | + "description": "Max radio commands per window." | |
| 37 | + }, | |
| 38 | + { | |
| 39 | + "name": "csb_block_radiowin", | |
| 40 | + "default": "10.0", | |
| 41 | + "description": "Radio rate-limit window in seconds." | |
| 42 | + } | |
| 43 | + ], | |
| 44 | + "commands": [ | |
| 45 | + { | |
| 46 | + "name": "amx_matchlive", | |
| 47 | + "access": "d (ADMIN_BAN)", | |
| 48 | + "description": "amx_matchlive <0|1> - toggle live blocking." | |
| 49 | + } | |
| 50 | + ], | |
| 51 | + "main": "addons/amxmodx/scripting/csb_match_block_cmds.sma" | |
| 52 | +} | |
| 0 | 53 |









