Initial release 1.0.0
Browse SourceInitial release.
4 changed files
with 207 additions and 0 deletions
A
CHANGELOG.md
+3 -0
A
README.md
+1 -0
A
addons/amxmodx/scripting/csb_classic_retake.sma
+151 -0
A
csb.json
+52 -0
CHANGELOG.md
A
| @@ -0,0 +1,3 @@ | ||
| 1 | +## 1.0.0 (2026-04-04) | |
| 2 | + | |
| 3 | +Initial release. |
README.md
A
| @@ -0,0 +1 @@ | ||
| 1 | +<p>d</p> |
addons/amxmodx/scripting/csb_classic_retake.sma
A
| @@ -0,0 +1,151 @@ | ||
| 1 | +/* | |
| 2 | + * CSB Classic Retake Setup | |
| 3 | + * Copyright (C) 2026 counter-strike-boost.com | |
| 4 | + * | |
| 5 | + * Turns a classic bomb map into a retake practice server. Every round it | |
| 6 | + * enforces a competitive CT:T ratio (default 4:3, moving the extras), hands | |
| 7 | + * out a fixed retake loadout - armour, a defuse kit for CTs, a rifle and | |
| 8 | + * nades - and calls the target bombsite (A or B) on the HUD so defenders know | |
| 9 | + * where to rotate. Self-contained: no external match core required. | |
| 10 | + * | |
| 11 | + * This program is free software: you can redistribute it and/or modify it | |
| 12 | + * under the terms of the GNU General Public License as published by the Free | |
| 13 | + * Software Foundation, either version 3 of the License, or (at your option) | |
| 14 | + * any later version. It is distributed in the hope that it will be useful, | |
| 15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | |
| 17 | + * Public License for more details: <https://www.gnu.org/licenses/>. | |
| 18 | + */ | |
| 19 | + | |
| 20 | +#include <amxmodx> | |
| 21 | +#include <amxmisc> | |
| 22 | +#include <cstrike> | |
| 23 | +#include <fun> | |
| 24 | + | |
| 25 | +new const PLUGIN[] = "CSB Classic Retake Setup" | |
| 26 | +new const VERSION[] = "1.0.0" | |
| 27 | +new const AUTHOR[] = "counter-strike-boost.com" | |
| 28 | + | |
| 29 | +new g_pEnabled, g_pCtCount, g_pTCount, g_pArmor | |
| 30 | +new g_iSite = 0 | |
| 31 | + | |
| 32 | +public plugin_init() | |
| 33 | +{ | |
| 34 | + register_plugin(PLUGIN, VERSION, AUTHOR) | |
| 35 | + | |
| 36 | + g_pEnabled = register_cvar("csb_retake_enabled", "1") | |
| 37 | + g_pCtCount = register_cvar("csb_retake_ct", "4") /* desired CT (defender) count */ | |
| 38 | + g_pTCount = register_cvar("csb_retake_t", "3") /* desired T (attacker) count */ | |
| 39 | + g_pArmor = register_cvar("csb_retake_armor", "100") | |
| 40 | + | |
| 41 | + /* New round (HLTV cue) — rebalance teams and call the site. */ | |
| 42 | + register_event("HLTV", "evNewRound", "a", "1=0", "2=0") | |
| 43 | + | |
| 44 | + /* Give the loadout a touch after spawn so the mod's own give is done. */ | |
| 45 | + register_event("ResetHUD", "evResetHud", "be") | |
| 46 | + | |
| 47 | + register_clcmd("say /site", "cmdSite", 0, "- show the current retake bombsite") | |
| 48 | +} | |
| 49 | + | |
| 50 | +public evNewRound() | |
| 51 | +{ | |
| 52 | + if (!get_pcvar_num(g_pEnabled)) | |
| 53 | + return | |
| 54 | + | |
| 55 | + balanceTeams() | |
| 56 | + | |
| 57 | + g_iSite = random_num(0, 1) /* 0 = A, 1 = B */ | |
| 58 | + | |
| 59 | + set_hudmessage(255, 200, 0, -1.0, 0.15, 0, 0.0, 4.0, 0.0, 0.1, -1) | |
| 60 | + show_hudmessage(0, "RETAKE SITE %s^nAttackers plant, defenders retake!", g_iSite ? "B" : "A") | |
| 61 | +} | |
| 62 | + | |
| 63 | +public cmdSite(id) | |
| 64 | +{ | |
| 65 | + client_print(id, print_chat, "[CSB] Current retake bombsite: %s", g_iSite ? "B" : "A") | |
| 66 | + return PLUGIN_HANDLED | |
| 67 | +} | |
| 68 | + | |
| 69 | +/* Enforce the configured CT:T split by moving the fullest side's extras. */ | |
| 70 | +balanceTeams() | |
| 71 | +{ | |
| 72 | + new wantCT = get_pcvar_num(g_pCtCount) | |
| 73 | + new wantT = get_pcvar_num(g_pTCount) | |
| 74 | + | |
| 75 | + new ctList[32], ctNum | |
| 76 | + new tList[32], tNum | |
| 77 | + teamMembers(CS_TEAM_CT, ctList, ctNum) | |
| 78 | + teamMembers(CS_TEAM_T, tList, tNum) | |
| 79 | + | |
| 80 | + /* Too many CTs -> push the tail over to T. */ | |
| 81 | + while (ctNum > wantCT && tNum < wantT && ctNum > 0) | |
| 82 | + { | |
| 83 | + new pid = ctList[--ctNum] | |
| 84 | + cs_set_user_team(pid, CS_TEAM_T) | |
| 85 | + tList[tNum++] = pid | |
| 86 | + } | |
| 87 | + | |
| 88 | + /* Too many Ts -> push the tail over to CT. */ | |
| 89 | + while (tNum > wantT && ctNum < wantCT && tNum > 0) | |
| 90 | + { | |
| 91 | + new pid = tList[--tNum] | |
| 92 | + cs_set_user_team(pid, CS_TEAM_CT) | |
| 93 | + ctList[ctNum++] = pid | |
| 94 | + } | |
| 95 | +} | |
| 96 | + | |
| 97 | +teamMembers(CsTeams:team, out[32], &count) | |
| 98 | +{ | |
| 99 | + new players[32], num | |
| 100 | + count = 0 | |
| 101 | + get_players(players, num, "ch") | |
| 102 | + | |
| 103 | + for (new i = 0; i < num; i++) | |
| 104 | + { | |
| 105 | + if (cs_get_user_team(players[i]) == team) | |
| 106 | + out[count++] = players[i] | |
| 107 | + } | |
| 108 | +} | |
| 109 | + | |
| 110 | +public evResetHud(id) | |
| 111 | +{ | |
| 112 | + if (!get_pcvar_num(g_pEnabled) || !is_user_alive(id)) | |
| 113 | + return | |
| 114 | + | |
| 115 | + set_task(0.4, "taskLoadout", id + 27000) | |
| 116 | +} | |
| 117 | + | |
| 118 | +public taskLoadout(param) | |
| 119 | +{ | |
| 120 | + new id = param - 27000 | |
| 121 | + | |
| 122 | + if (!is_user_connected(id) || !is_user_alive(id)) | |
| 123 | + return | |
| 124 | + | |
| 125 | + new CsTeams:team = cs_get_user_team(id) | |
| 126 | + if (team != CS_TEAM_T && team != CS_TEAM_CT) | |
| 127 | + return | |
| 128 | + | |
| 129 | + new armor = get_pcvar_num(g_pArmor) | |
| 130 | + if (armor > 0) | |
| 131 | + cs_set_user_armor(id, armor, CS_ARMOR_VESTHELM) | |
| 132 | + | |
| 133 | + give_item(id, "weapon_hegrenade") | |
| 134 | + give_item(id, "weapon_flashbang") | |
| 135 | + | |
| 136 | + if (team == CS_TEAM_CT) | |
| 137 | + { | |
| 138 | + give_item(id, "weapon_m4a1") | |
| 139 | + give_item(id, "weapon_deagle") | |
| 140 | + give_item(id, "item_thighpack") /* defuse kit */ | |
| 141 | + cs_set_user_bpammo(id, CSW_M4A1, 90) | |
| 142 | + cs_set_user_bpammo(id, CSW_DEAGLE, 35) | |
| 143 | + } | |
| 144 | + else | |
| 145 | + { | |
| 146 | + give_item(id, "weapon_ak47") | |
| 147 | + give_item(id, "weapon_deagle") | |
| 148 | + cs_set_user_bpammo(id, CSW_AK47, 90) | |
| 149 | + cs_set_user_bpammo(id, CSW_DEAGLE, 35) | |
| 150 | + } | |
| 151 | +} |
csb.json
A
| @@ -0,0 +1,52 @@ | ||
| 1 | +{ | |
| 2 | + "name": "CSB Classic Retake Setup", | |
| 3 | + "category": "classic", | |
| 4 | + "tags": "", | |
| 5 | + "image": "", | |
| 6 | + "original_author": "", | |
| 7 | + "original_url": "", | |
| 8 | + "license": "GPL-3.0", | |
| 9 | + "title": "CSB Classic Retake Setup", | |
| 10 | + "short_desc": "", | |
| 11 | + "version": "1.0.0", | |
| 12 | + "amxx_min": "1.8.2", | |
| 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": "cstrike,fun", | |
| 20 | + "install_notes": "1. Enable the cstrike and fun modules in addons/amxmodx/configs/modules.ini\n2. Compile the .sma (or use the site compiler) and put the .amxx in addons/amxmodx/plugins/\n3. Add csb_classic_retake.amxx to addons/amxmodx/configs/plugins.ini\n4. Change to a de_ bomb map. Tune csb_retake_ct / csb_retake_t for your player count.", | |
| 21 | + "known_conflicts": "Free-for-all, gun-game and other loadout managers.", | |
| 22 | + "cvars": [ | |
| 23 | + { | |
| 24 | + "name": "csb_retake_enabled", | |
| 25 | + "default": "1", | |
| 26 | + "description": "Master enable toggle." | |
| 27 | + }, | |
| 28 | + { | |
| 29 | + "name": "csb_retake_ct", | |
| 30 | + "default": "4", | |
| 31 | + "description": "Desired CT (defender) count per round." | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "name": "csb_retake_t", | |
| 35 | + "default": "3", | |
| 36 | + "description": "Desired T (attacker) count per round." | |
| 37 | + }, | |
| 38 | + { | |
| 39 | + "name": "csb_retake_armor", | |
| 40 | + "default": "100", | |
| 41 | + "description": "Armour value handed out (kevlar + helmet)." | |
| 42 | + } | |
| 43 | + ], | |
| 44 | + "commands": [ | |
| 45 | + { | |
| 46 | + "name": "say /site", | |
| 47 | + "access": "", | |
| 48 | + "description": "Show the current retake bombsite (A or B)." | |
| 49 | + } | |
| 50 | + ], | |
| 51 | + "main": "addons/amxmodx/scripting/csb_classic_retake.sma" | |
| 52 | +} | |
| 0 | 53 |









