#include <amxmodx>
#include <reapi>
new HookChain:HookChain_CBasePlayer_PreThink;
new bool: knife = false;
public plugin_init()
{
register_event("HLTV", "eRoundStart", "a", "1=0", "2=0");
register_concmd("amx_knf", "AdminKnifeRound", ADMIN_MENU);
DisableHookChain((HookChain_CBasePlayer_PreThink = RegisterHookChain(RG_CBasePlayer_PreThink, "CBasePlayer_PreThink_Post", true)));
}
public eRoundStart()
{
switch(knife)
{
case true:
{
EnableHookChain(HookChain_CBasePlayer_PreThink);
knife = false;
}
case false: DisableHookChain(HookChain_CBasePlayer_PreThink);
}
}
public AdminKnifeRound(id)
{
knife = true;
}
public CBasePlayer_PreThink_Post(id)
{
if(is_user_alive(id))
{
if(get_member(get_member(id, m_pActiveItem), m_iId) != WEAPON_KNIFE)
engclient_cmd(id, "weapon_knife");
}
}