Raised This Month: $51 Target: $400
 12% 

OnTakeDamage dont detect grenades


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lawyn
Junior Member
Join Date: Jul 2020
Old 02-13-2021 , 07:54   OnTakeDamage dont detect grenades
Reply With Quote #1

On a new csgo update, OnTakeDamae functions, dont detect grenades.
__________________
Lawyn is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-13-2021 , 11:41   Re: OnTakeDamage dont detect grenades
Reply With Quote #2

Could you tell more specific. OS. MM:S and SM version.
Bacardi is offline
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Old 02-16-2021 , 09:12   Re: OnTakeDamage dont detect grenades
Reply With Quote #3

Quote:
Originally Posted by Lawyn View Post
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.
__________________
Mystik Spiral is offline
Lawyn
Junior Member
Join Date: Jul 2020
Old 02-16-2021 , 12:49   Re: OnTakeDamage dont detect grenades
Reply With Quote #4

Quote:
Originally Posted by Mystik Spiral View Post
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.
Thanks, working!
__________________
Lawyn is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode