public plugin_init()
{
RegisterHookChain(RG_ThrowHeGrenade, "@RG_ThrowHeGrenade_Post", true);
RegisterHookChain(RG_CGrenade_ExplodeHeGrenade, "@RG_CGrenade_ExplodeHeGrenade_Pre", false);
register_clcmd("say /j", "@grenade_j");
}
@grenade_j(index)
{
rg_give_custom_item(index, WEAPON_REFERANCE, GT_APPEND, 12412);
}
@RG_ThrowHeGrenade_Post(const index, Float:vecStart[3], Float:vecVelocity[3], Float:time, const team, const usEvent)
{
new item = get_member(index, m_pActiveItem);
if(get_entvar(item, var_impulse) != 12412)
{
return HC_CONTINUE;
}
new ent = GetHookChainReturn(ATYPE_INTEGER);
if(is_nullent(ent))
{
return HC_CONTINUE;
}
set_entvar(ent, var_iuser1, 12412);
return HC_CONTINUE;
}
@RG_CGrenade_ExplodeHeGrenade_Pre(const ent, tracehandle, const bitsDamageType) {
if(get_entvar(ent, var_iuser1) != 12412)
{
return HC_CONTINUE;
}
server_print("Custom explode");
return HC_CONTINUE;
}