if (is_ent_alive)
{
if (owner == ent || pev(ent, pev_takedamage) == DAMAGE_NO)
return FMRES_IGNORED;
if (get_user_team(owner) == get_user_team(ent))
if (!get_pcvar_num(friendlyfire))
return FMRES_IGNORED;
//ExecuteHam(Ham_TakeDamage, ent, owner, owner, float(get_pcvar_num(damge)), 4098);
new Float:vecVelocity[3];get_entvar(bullet, var_velocity, vecVelocity);
new iTrace = create_tr2();
rg_multidmg_clear();
ExecuteHamB(Ham_TraceAttack, ent, owner, float(get_pcvar_num(damge)), vecVelocity, iTrace, 4098/*(DMG_BULLET|DMG_NEVERGIB)*/);
rg_multidmg_apply(ent, owner);
free_tr2(iTrace);
}
if (is_ent_alive)
{
if (owner == ent || pev(ent, pev_takedamage) == DAMAGE_NO)
return FMRES_IGNORED;
if (get_user_team(owner) == get_user_team(ent))
if (!get_pcvar_num(friendlyfire))
return FMRES_IGNORED;
new Float:vecVelocity[3];
pev(bullet, pev_velocity, vecVelocity);
new iTrace = create_tr2();
new Float:vecEnd[3]; xs_vec_add(origin, vecVelocity, vecEnd);
engfunc(EngFunc_TraceLine, origin, vecEnd, DONT_IGNORE_MONSTERS, bullet, iTrace);
if (get_tr2(iTrace, TR_pHit) == ent) {
#define HITGROUP_SHIELD 8
if (get_tr2(iTrace, TR_iHitgroup) == HITGROUP_SHIELD) {
// some effects;
}
else {
ExecuteHam(Ham_TakeDamage, ent, owner, owner, float(get_pcvar_num(damge)), 4098);
}
}
free_tr2(iTrace);
}