/*
* CSB Jail Days
* Copyright (C) 2026 counter-strike-boost.com
*
* Warden-driven jailbreak day system. Ts are frozen at round start until the
* warden (a CT who claims it with /warden) picks a day from a menu: Free Day,
* War Day, Hide & Seek Day, Gun Toss Day or Knife Fight Day. Each day applies a
* small ruleset (weapon give/strip, speed, friendly fire) and is announced.
*
* 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 Jail Days"
new const VERSION[] = "1.0.0"
new const AUTHOR[] = "counter-strike-boost.com"
#define DAY_NONE 0
#define DAY_FREE 1
#define DAY_WAR 2
#define DAY_HNS 3
#define DAY_GUNTOSS 4
#define DAY_KNIFE 5
new const g_szDayName[][] =
{
"None", "Free Day", "War Day", "Hide & Seek Day", "Gun Toss Day", "Knife Fight Day"
}
new g_pEnabled, g_pFreezeTime
new g_iWarden
new g_iDay
new g_iSync
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_pEnabled = register_cvar("csb_jail_enabled", "1")
g_pFreezeTime = register_cvar("csb_jail_freeze", "8")
register_clcmd("say /warden", "cmdWarden")
register_clcmd("say /days", "cmdDays")
register_clcmd("say /day", "cmdDays")
register_concmd("amx_setwarden", "cmdSetWarden", ADMIN_BAN, " - assign the warden")
register_logevent("evRoundStart", 2, "1=Round_Start")
g_iSync = CreateHudSyncObj()
}
public client_disconnected(id)
{
if (id == g_iWarden)
{
g_iWarden = 0
client_print(0, print_chat, "[CSB Jail] The warden left. Type /warden to claim it.")
}
}
public evRoundStart()
{
if (!get_pcvar_num(g_pEnabled))
return
g_iDay = DAY_NONE
new ft = get_pcvar_num(g_pFreezeTime)
if (ft < 1)
ft = 1
new players[32], num
get_players(players, num, "ae")
for (new i = 0; i < num; i++)
{
new p = players[i]
if (get_user_team(p) == 1)
{
setFrozen(p, true)
set_task(float(ft), "taskUnfreeze", p)
}
}
}
public taskUnfreeze(id)
{
if (is_user_alive(id) && g_iDay == DAY_NONE)
setFrozen(id, false)
}
public cmdWarden(id)
{
if (!get_pcvar_num(g_pEnabled))
return PLUGIN_HANDLED
if (get_user_team(id) != 2)
{
client_print(id, print_chat, "[CSB Jail] Only CTs can be the warden.")
return PLUGIN_HANDLED
}
if (g_iWarden && is_user_connected(g_iWarden))
{
new wn[32]
get_user_name(g_iWarden, wn, charsmax(wn))
client_print(id, print_chat, "[CSB Jail] %s is already the warden.", wn)
return PLUGIN_HANDLED
}
g_iWarden = id
new name[32]
get_user_name(id, name, charsmax(name))
client_print(0, print_chat, "[CSB Jail] %s is now the warden. Type /days to start a day.", name)
return PLUGIN_HANDLED
}
public cmdSetWarden(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
new arg[32]
read_argv(1, arg, charsmax(arg))
new target = cmd_target(id, arg, CMDTARGET_ONLY_ALIVE)
if (!target)
return PLUGIN_HANDLED
g_iWarden = target
new name[32]
get_user_name(target, name, charsmax(name))
client_print(0, print_chat, "[CSB Jail] %s was made the warden by an admin.", name)
return PLUGIN_HANDLED
}
public cmdDays(id)
{
if (!get_pcvar_num(g_pEnabled))
return PLUGIN_HANDLED
if (id != g_iWarden)
{
client_print(id, print_chat, "[CSB Jail] Only the warden can start a day.")
return PLUGIN_HANDLED
}
new menu = menu_create("CSB Jail - pick a day:", "daysHandler")
menu_additem(menu, "Free Day", "1", 0)
menu_additem(menu, "War Day", "2", 0)
menu_additem(menu, "Hide & Seek Day", "3", 0)
menu_additem(menu, "Gun Toss Day", "4", 0)
menu_additem(menu, "Knife Fight Day", "5", 0)
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0)
return PLUGIN_HANDLED
}
public daysHandler(id, menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new info[4], name[32], access, callback
menu_item_getinfo(menu, item, access, info, charsmax(info), name, charsmax(name), callback)
menu_destroy(menu)
applyDay(str_to_num(info))
return PLUGIN_HANDLED
}
applyDay(day)
{
g_iDay = day
new players[32], num
get_players(players, num, "ae")
for (new i = 0; i < num; i++)
{
new p = players[i]
setFrozen(p, false)
switch (day)
{
case DAY_FREE:
{
set_user_maxspeed(p, 250.0)
}
case DAY_WAR:
{
strip_user_weapons(p)
give_item(p, "weapon_knife")
give_item(p, "weapon_m4a1")
give_item(p, "weapon_ak47")
set_user_health(p, 100)
server_cmd("mp_friendlyfire 1")
}
case DAY_HNS:
{
if (get_user_team(p) == 1)
{
strip_user_weapons(p)
give_item(p, "weapon_knife")
set_user_maxspeed(p, 320.0)
}
}
case DAY_GUNTOSS:
{
strip_user_weapons(p)
give_item(p, "weapon_knife")
give_item(p, "weapon_hegrenade")
}
case DAY_KNIFE:
{
strip_user_weapons(p)
give_item(p, "weapon_knife")
}
}
}
set_hudmessage(0, 255, 100, -1.0, 0.25, 0, 0.0, 4.0, 0.0, 0.0, -1)
ShowSyncHudMsg(0, g_iSync, "%s", g_szDayName[day])
client_print(0, print_chat, "[CSB Jail] The warden started: %s", g_szDayName[day])
}
setFrozen(id, bool:on)
{
new flags = pev(id, pev_flags)
if (on)
set_pev(id, pev_flags, flags | FL_FROZEN)
else
set_pev(id, pev_flags, flags & ~FL_FROZEN)
}