#include <amxmodx>
#include <hamsandwich>
#include <reapi>
public plugin_init()
{
register_plugin("Hide'N'Seek Mode", "1.0", "CG");
RegisterHookChain(RG_CSGameRules_RestartRound, "RestartRound", .post = true);
RegisterHookChain(RG_CBasePlayer_GiveDefaultItems, "GiveDefaultItems", .post = false);
RegisterHookChain(RG_PlayerBlind, "PlayerBlind", .post = false);
RegisterHookChain(RG_RoundEnd, "RoundEnd", .post = false);
RegisterHookChain(RG_CSGameRules_GiveC4, "GiveC4", .post = false);
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_knife", "PrimaryAttack");
}
public plugin_cfg()
{
set_cvar_num("sv_airaccelerate", 100);
set_cvar_num("mp_buytime", 0);
}
public RestartRound()
{
for(new i = 1; i <= MaxClients; i++)
{
if(get_member(i, m_iTeam) == TEAM_CT)
{
set_entvar(i, var_flags, get_entvar(i, var_flags) | FL_FROZEN);
set_task(5.0, "UnFrozenCT", i);
}
}
}
public UnFrozenCT(const player)
set_entvar(player, var_flags, get_entvar(player, var_flags) & ~FL_FROZEN);
public GiveDefaultItems(const player)
{
if(get_member(player, m_iTeam) == TEAM_CT)
rg_give_item(player, "weapon_knife");
if(get_member(player, m_iTeam) == TEAM_TERRORIST)
{
rg_give_item(player, "weapon_smokegrenade");
rg_give_item(player, "weapon_flashbang");
rg_set_user_bpammo(player, WEAPON_FLASHBANG, 2);
}
return HC_SUPERCEDE;
}
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 GiveC4()
return HC_SUPERCEDE;
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;
}