/* * CSB First Blood * Copyright (C) 2026 counter-strike-boost.com * * Detects the first kill of each round in a DeathMsg hook, plays a sound, * announces it in coloured chat and hands the killer a configurable reward * (bonus HP, cash, or both). Keeps a per-map first-blood tally and calls out * the current leader. * * 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 #include new const PLUGIN[] = "CSB First Blood" new const VERSION[] = "1.0.0" new const AUTHOR[] = "counter-strike-boost.com" new g_pEnabled, g_pReward, g_pHp, g_pCash, g_pSound new bool:g_bDone = false new g_iFbCount[33] public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) g_pEnabled = register_cvar("csb_fb_enabled", "1") g_pReward = register_cvar("csb_fb_reward", "3") /* 0 none, 1 hp, 2 cash, 3 both */ g_pHp = register_cvar("csb_fb_hp", "25") g_pCash = register_cvar("csb_fb_cash", "1000") g_pSound = register_cvar("csb_fb_sound", "buttons/bell1.wav") register_event("DeathMsg", "eventDeath", "a", "1>0") register_event("HLTV", "eventNewRound", "a", "1=0", "2=0") } public client_putinserver(id) { g_iFbCount[id] = 0 } public eventNewRound() { g_bDone = false } public eventDeath() { if (g_bDone || !get_pcvar_num(g_pEnabled)) return new killer = read_data(1) new victim = read_data(2) if (killer < 1 || killer > 32 || killer == victim) return if (!is_user_connected(killer)) return g_bDone = true g_iFbCount[killer]++ reward(killer) new sound[64] get_pcvar_string(g_pSound, sound, charsmax(sound)) if (sound[0]) client_cmd(0, "spk ^"%s^"", sound) new name[32] get_user_name(killer, name, charsmax(name)) client_print(0, print_chat, "^x04[CSB]^x01 First blood!^x03 %s^x01 drew it first this round.", name) announceLeader() } reward(id) { new mode = get_pcvar_num(g_pReward) if (mode == 1 || mode == 3) { if (is_user_alive(id)) { new hp = get_user_health(id) + get_pcvar_num(g_pHp) set_user_health(id, hp) client_print(id, print_chat, "[CSB] First-blood bonus: +%d HP.", get_pcvar_num(g_pHp)) } } if (mode == 2 || mode == 3) { new add = get_pcvar_num(g_pCash) new money = cs_get_user_money(id) + add if (money > 16000) money = 16000 cs_set_user_money(id, money) client_print(id, print_chat, "[CSB] First-blood bonus: +$%d.", add) } } announceLeader() { new leader = 0, best = 0 new players[32], num, pid get_players(players, num, "c") for (new i = 0; i < num; i++) { pid = players[i] if (g_iFbCount[pid] > best) { best = g_iFbCount[pid] leader = pid } } if (leader && best >= 2) { new name[32] get_user_name(leader, name, charsmax(name)) client_print(0, print_chat, "[CSB] First-blood leader this map: %s (%d).", name, best) } }