if (trace_ent.invincible_finished < time) // target has No pent
if (vlen (org - self.origin) < 200 && trace_ent.ishuman && self.weapon == 2) // range is under 200, for humans only attacker has ssg
{
if (trace_ent.origin_y + 5 < org_y) // +/- 5 unit buffer from targets center
trace_ent.punchangle_y = vlen(org - self.origin) /5; // a value of about 40 just for tests
if (trace_ent.origin_y - 5 > org_y)
trace_ent.punchangle_y = vlen(org - self.origin) / -5;
}
Is there a better way to do this and also include the _x and _z factors as well? Has any other mod tried this? Feel free to add code and colaborate.
You can have fun with punchvector also. I had a small mini mod where you could punch players and I used something like this for when the player got hit...