Improved knockback, renamed ZTele function, changed ZStuck to reset velocity, modified velocity changing function, removed unneeded offset (basevelocity)

This commit is contained in:
Greyscale
2009-03-30 21:40:56 +02:00
parent 965de0e697
commit 1dc1f5cefe
6 changed files with 72 additions and 23 deletions

View File

@ -304,18 +304,21 @@ public Action:PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast)
if (!StrEqual(weapon, "hegrenade"))
{
GetClientAbsOrigin(attacker, attackerloc);
GetPlayerEyePosition(attacker, attackerloc);
new bool:shotgun = (StrEqual(weapon, "m3") || StrEqual(weapon, "xm1014"));
new Float:attackerang[3];
GetPlayerEyeAngles(attacker, attackerang);
KnockBack(index, clientloc, attackerloc, knockback, dmg, shotgun);
TR_TraceRayFilter(attackerloc, attackerang, MASK_ALL, RayType_Infinite, TraceRayFilter);
TR_GetEndPosition(clientloc);
KnockBack(index, clientloc, attackerloc, knockback, dmg, false);
}
else
{
new Float:heLoc[3];
FindExplodingGrenade(heLoc);
FindExplodingGrenade(attackerloc);
KnockBack(index, clientloc, heLoc, knockback, dmg, true);
KnockBack(index, clientloc, attackerloc, knockback, dmg, true);
}
}
}
@ -360,6 +363,16 @@ public Action:PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast)
UpdateAlphaDamaged(index);
}
public bool:TraceRayFilter(entity, contentsMask)
{
if (entity > 0 && entity < MAXPLAYERS)
{
return false;
}
return true;
}
FindExplodingGrenade(Float:heLoc[3])
{
decl String:classname[64];