/* * CSB AWP Arena * Copyright (C) 2026 counter-strike-boost.com * * AWP-only game mode. Everyone spawns with an AWP and a knife, unlimited reserve * ammo, buying is blocked and death triggers an instant respawn. An optional * no-scope mode resets the player's FOV whenever they hold the AWP so the scope * cannot be used. A small HUD tracks each player's AWP kills. * * 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 #include new const PLUGIN[] = "CSB AWP Arena" new const VERSION[] = "1.0.0" new const AUTHOR[] = "counter-strike-boost.com" new g_pEnabled, g_pNoScope, g_pRespawn new g_iKills[33] new g_iHudSync public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) g_pEnabled = register_cvar("csb_awp_enabled", "1") g_pNoScope = register_cvar("csb_awp_noscope", "0") g_pRespawn = register_cvar("csb_awp_respawn", "2.0") RegisterHam(Ham_Spawn, "player", "fwSpawnPost", 1) register_event("DeathMsg", "eventDeath", "a", "1>0") register_event("CurWeapon", "eventCurWeapon", "be", "1=1") register_clcmd("buy", "blockBuy") register_clcmd("buyammo", "blockBuy") register_clcmd("buyequip", "blockBuy") g_iHudSync = CreateHudSyncObj() set_task(1.0, "taskHud", 0, _, _, "b") } public client_putinserver(id) { g_iKills[id] = 0 } public fwSpawnPost(id) { if (!get_pcvar_num(g_pEnabled)) return if (!is_user_alive(id)) return set_task(0.2, "taskEquip", id) } public taskEquip(id) { if (!is_user_alive(id)) return strip_user_weapons(id) give_item(id, "weapon_knife") give_item(id, "weapon_awp") cs_set_user_bpammo(id, CSW_AWP, 90) } public eventCurWeapon(id) { if (!get_pcvar_num(g_pEnabled) || !get_pcvar_num(g_pNoScope)) return if (!is_user_alive(id)) return new weapon = read_data(2) if (weapon == CSW_AWP) set_pev(id, pev_fov, 90.0) } public blockBuy(id) { if (get_pcvar_num(g_pEnabled)) { client_print(id, print_chat, "[CSB] Buying is disabled in AWP Arena.") return PLUGIN_HANDLED } return PLUGIN_CONTINUE } public eventDeath() { new killer = read_data(1) new victim = read_data(2) if (killer >= 1 && killer <= 32 && killer != victim) g_iKills[killer]++ if (!get_pcvar_num(g_pEnabled)) return if (victim >= 1 && victim <= 32) set_task(get_pcvar_float(g_pRespawn), "taskRespawn", victim) } public taskRespawn(id) { if (!is_user_connected(id) || is_user_alive(id)) return if (get_user_team(id) != 1 && get_user_team(id) != 2) return ExecuteHamB(Ham_CS_RoundRespawn, id) } public taskHud() { if (!get_pcvar_num(g_pEnabled)) return new players[32], num get_players(players, num, "ch") for (new i = 0; i < num; i++) { new id = players[i] set_hudmessage(0, 200, 255, 0.02, 0.85, 0, 0.0, 1.1, 0.0, 0.0, -1) ShowSyncHudMsg(id, g_iHudSync, "AWP kills: %d", g_iKills[id]) } }