Quote:
Originally Posted by Lawyn
On a new csgo update, OnTakeDamae functions, dont detect grenades.
|
I wrote if for L4D2, but take a look at my plugin "
Reverse Friendly-Fire" for a method of detecting if damage came from a grenade (fired by a grenade launcher).
Basically...
Within OnTakeDamage I have this entry...
Code:
char sInflictorClass[64];
if (inflictor > MaxClients)
{
GetEdictClassname(inflictor, sInflictorClass, sizeof(sInflictorClass));
}
bool bWeaponGL = IsWeaponGrenadeLauncher(sInflictorClass);
...and the function looks like this...
Code:
stock bool IsWeaponGrenadeLauncher(char[] sInflictorClass)
{
return (StrEqual(sInflictorClass, "grenade_launcher_projectile"));
}
If the return value is true, the damage came from a grenade...at least in L4D2, not sure of the differences with CSGO.
__________________