/* * CSB Bomb Bonus * Copyright (C) 2026 counter-strike-boost.com * * Rewards players for the bomb objective. Using the bomb_planted, bomb_defused * and bomb_explode game events, the planter, defuser and (on a successful * detonation) the whole Terrorist team receive a configurable reward: money, * health and armor. Each reward is announced in colour and guarded by a * once-per-round check so nothing can be farmed. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. It is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See for details. */ #include #include #include new const PLUGIN[] = "CSB Bomb Bonus" new const VERSION[] = "1.0.0" new const AUTHOR[] = "counter-strike-boost.com" new g_pMoney, g_pHealth, g_pArmor new bool:g_bPlantRewarded, g_bDefuseRewarded, g_bExplodeRewarded public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) g_pMoney = register_cvar("csb_bonus_money", "1000") g_pHealth = register_cvar("csb_bonus_health", "25") g_pArmor = register_cvar("csb_bonus_armor", "50") register_logevent("eventRoundStart", 2, "1=Round_Start") register_logevent("eventPlanted", 3, "2=Planted_The_Bomb") register_logevent("eventDefused", 3, "2=Defused_The_Bomb") register_logevent("eventExplode", 3, "2=Target_Bombed") } public eventRoundStart() { g_bPlantRewarded = false g_bDefuseRewarded = false g_bExplodeRewarded = false } reward(id) { if (!is_user_connected(id)) return new money = get_pcvar_num(g_pMoney) if (money != 0) { new cur = cs_get_user_money(id) new give = cur + money if (give > 16000) give = 16000 else if (give < 0) give = 0 cs_set_user_money(id, give) } if (is_user_alive(id)) { new hp = get_pcvar_num(g_pHealth) if (hp > 0) set_user_health(id, get_user_health(id) + hp) new ar = get_pcvar_num(g_pArmor) if (ar > 0) { new newArmor = get_user_armor(id) + ar if (newArmor > 100) newArmor = 100 cs_set_user_armor(id, newArmor, CS_ARMOR_KEVLAR) } } } /* the planter is the last player to use the bomb; grab them from the log event */ public eventPlanted() { if (g_bPlantRewarded) return g_bPlantRewarded = true new id = getLogPlayer() if (id) { reward(id) new name[32] get_user_name(id, name, charsmax(name)) client_print(0, print_chat, "^x04[Bomb]^x01 %s planted the bomb and earned a bonus!", name) } } public eventDefused() { if (g_bDefuseRewarded) return g_bDefuseRewarded = true new id = getLogPlayer() if (id) { reward(id) new name[32] get_user_name(id, name, charsmax(name)) client_print(0, print_chat, "^x04[Bomb]^x01 %s defused the bomb and earned a bonus!", name) } } public eventExplode() { if (g_bExplodeRewarded) return g_bExplodeRewarded = true /* reward the whole Terrorist team */ new players[32], num get_players(players, num, "e", "TERRORIST") for (new i = 0; i < num; i++) reward(players[i]) client_print(0, print_chat, "^x04[Bomb]^x01 The bomb detonated - Terrorists earn a team bonus!") } getLogPlayer() { new loguser[80], name[32] read_logargv(0, loguser, charsmax(loguser)) /* format: "Name" */ new pos = contain(loguser, "<") if (pos < 1) return 0 copy(name, charsmax(name), loguser) if (pos < charsmax(name)) name[pos] = 0 new players[32], num get_players(players, num, "ch") for (new i = 0; i < num; i++) { new pn[32] get_user_name(players[i], pn, charsmax(pn)) if (equal(pn, name)) return players[i] } return 0 }