/*
* CSB Weapon Restrict
* Copyright (C) 2026 counter-strike-boost.com
*
* Blocks selected weapons and equipment from being bought. The plugin hooks the
* direct buy alias commands (ak47, awp, hegren, vesthelm, ...) and returns
* PLUGIN_HANDLED for anything restricted, telling the player why. Admins can
* toggle restrictions live from a menu, and a per-map config is executed on map
* start.
*
* Inspired by the AMX Mod X "Restrict Weapons" plugin. This is an independent
* GPL re-implementation; no original code is reused.
*
* 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 Weapon Restrict"
new const VERSION[] = "1.0.0"
new const AUTHOR[] = "counter-strike-boost.com"
/* Every buyable thing: the console command the client sends, plus a label. */
new const g_szAlias[][] =
{
"usp", "glock", "deagle", "p228", "elite", "fn57",
"galil", "ak47", "scout", "sg552", "awp", "g3sg1",
"famas", "m4a1", "aug", "sg550",
"m3", "xm1014",
"mac10", "tmp", "mp5", "ump45", "p90",
"m249",
"hegren", "flash", "sgren",
"vest", "vesthelm", "defuser", "nvgs"
}
new const g_szLabel[][] =
{
"USP", "Glock", "Desert Eagle", "P228", "Dual Elites", "Five-SeveN",
"Galil", "AK-47", "Scout", "SG-552", "AWP", "G3SG1",
"FAMAS", "M4A1", "AUG", "SG-550",
"M3 Super 90", "XM1014",
"MAC-10", "TMP", "MP5", "UMP-45", "P90",
"M249 Para",
"HE Grenade", "Flashbang", "Smoke Grenade",
"Kevlar", "Kevlar+Helmet", "Defuse Kit", "Night Vision"
}
new bool:g_bRestricted[sizeof(g_szAlias)]
new g_pEnabled
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_pEnabled = register_cvar("csb_restrict_enabled", "1")
for (new i = 0; i < sizeof(g_szAlias); i++)
register_clcmd(g_szAlias[i], "cmdBuy")
register_clcmd("say /restrictmenu", "cmdMenu", ADMIN_CVAR)
register_clcmd("say_team /restrictmenu", "cmdMenu", ADMIN_CVAR)
register_concmd("amx_restrict", "cmdRestrict", ADMIN_CVAR, " - restrict a weapon/equipment")
register_concmd("amx_unrestrict", "cmdUnrestrict", ADMIN_CVAR, " - allow a weapon/equipment again")
register_concmd("amx_restrictlist", "cmdList", ADMIN_CVAR, "- list currently restricted items")
}
public plugin_cfg()
{
/* Per-map override: configs/csb_restrict/