/*
* CSB Round Money
* Copyright (C) 2026 counter-strike-boost.com
*
* Full control over the CS economy for deathmatch, GunGame and fun servers.
* Options for a fixed start amount at spawn, a per-kill reward, a flat per-round
* income for everyone, and a headshot bonus - all applied with cs_set_user_money
* so the default buy economy can be replaced with something that fits the mode.
*
* 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
new const PLUGIN[] = "CSB Round Money"
new const VERSION[] = "1.0.0"
new const AUTHOR[] = "counter-strike-boost.com"
new g_pEnabled, g_pFixed, g_pStart, g_pKill, g_pHeadshot, g_pRoundIncome
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_pEnabled = register_cvar("csb_money_enabled", "1")
g_pFixed = register_cvar("csb_money_fixed", "0")
g_pStart = register_cvar("csb_money_start", "800")
g_pKill = register_cvar("csb_money_kill", "300")
g_pHeadshot = register_cvar("csb_money_headshot", "150")
g_pRoundIncome = register_cvar("csb_money_roundincome", "0")
register_event("ResetHUD", "eventSpawn", "be")
register_event("DeathMsg", "eventDeath", "a", "1>0")
register_logevent("eventRoundStart", 2, "1=Round_Start")
}
setMoney(id, amount)
{
if (amount < 0)
amount = 0
else if (amount > 16000)
amount = 16000
cs_set_user_money(id, amount)
}
addMoney(id, amount)
{
setMoney(id, cs_get_user_money(id) + amount)
}
public eventSpawn(id)
{
if (!get_pcvar_num(g_pEnabled) || !is_user_connected(id))
return
/* fixed start money each spawn */
if (get_pcvar_num(g_pFixed))
setMoney(id, get_pcvar_num(g_pStart))
}
public eventRoundStart()
{
if (!get_pcvar_num(g_pEnabled))
return
new income = get_pcvar_num(g_pRoundIncome)
if (income == 0)
return
new players[32], num
get_players(players, num, "ch")
for (new i = 0; i < num; i++)
addMoney(players[i], income)
}
public eventDeath()
{
if (!get_pcvar_num(g_pEnabled))
return
new killer = read_data(1)
new victim = read_data(2)
new headshot = read_data(3)
if (killer < 1 || killer > 32 || killer == victim || !is_user_connected(killer))
return
new reward = get_pcvar_num(g_pKill)
if (headshot)
reward += get_pcvar_num(g_pHeadshot)
if (reward != 0)
addMoney(killer, reward)
}