#include <amxmodx>
#include <hamsandwich>
#include <reapi>
#define TASK_ID 67582
public plugin_init()
{
register_plugin("Hide'N'Seek Mode", "1.0b", "CG");
RegisterHookChain(RG_CSGameRules_RestartRound, "RestartRound_Post", .post = true);
RegisterHookChain(RG_PlayerBlind, "PlayerBlind", .post = false);
RegisterHookChain(RG_RoundEnd, "RoundEnd", .post = false);
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_knife", "PrimaryAttack");
}
public plugin_cfg()
{
set_cvar_num("sv_airaccelerate", 100);
set_cvar_num("mp_buytime", 0);
set_cvar_num("mp_give_player_c4", 0);
}
public RestartRound_Post()
{
for(new i = 1; i <= MaxClients; i++)
{
if(!is_user_connected(i))
return;
rg_remove_all_items(i);
if(get_member(i, m_iTeam) == TEAM_CT)
{
rg_give_item(i, "weapon_knife");
set_entvar(i, var_flags, get_entvar(i, var_flags) | FL_FROZEN);
set_task(5.0, "UnFrozenCT", id + TASK_ID);
}
else
{
rg_give_item(i, "weapon_smokegrenade");
rg_give_item(i, "weapon_flashbang");
rg_set_user_bpammo(i, WEAPON_FLASHBANG, 2);
rg_set_user_footsteps(i, true);
}
}
}
public UnFrozenCT(const player)
set_entvar(player, var_flags, get_entvar(player, var_flags) & ~FL_FROZEN);
public PlayerBlind(const index, const inflictor, const attacker, const Float:fadeTime, const Float:fadeHold, const alpha, Float:color[3])
{
if(index == attacker || (get_member(index, m_iTeam) == get_member(attacker, m_iTeam)))
{
set_member(index, m_blindAlpha, 0);
return HC_SUPERCEDE;
}
return HC_CONTINUE;
}
public RoundEnd(WinStatus: iStatus, ScenarioEventEndRound: iEvent, Float: flDelay)
{
if(iStatus != WINSTATUS_CTS && iStatus != WINSTATUS_TERRORISTS)
return;
if(iStatus == WINSTATUS_CTS)
rg_swap_all_players();
}
public PrimaryAttack(this)
{
new player = get_member(this, m_pPlayer);
if(get_member(player, m_iTeam) == TEAM_CT)
ExecuteHamB(Ham_Weapon_SecondaryAttack, this);
return HAM_SUPERCEDE;
}