Grenade damage from Ham_TakeDamage
Ok....as the title says, i'm trying to get grenade damage from Ham_TakeDamage (using the damage bits) Reading the HLSDK it says that it does DMG_BLAST damage, but my code isn't picking it up. Here it is....
Code:
public takeDamage_pre(victimID, inflictor, attackerID, Float:flDmg, dmgBits)the else prints this.... "dmgBits: 16777216 blast: 6" Or is there a better way of determining if it was a grenade hit? |
Re: Grenade damage from Ham_TakeDamage
http://forums.alliedmods.net/showthread.php?t=88506
As far as I read DMG_BLAST must be the c4 damage, not the grenade one. |
Re: Grenade damage from Ham_TakeDamage
Ah, thank you. I didn't get that far in my searching.
That's weird, though, considering.... Code:
// do damageBut i suppose that is doing other types of explosion damage, not grenades. |
Re: Grenade damage from Ham_TakeDamage
I am not sure at all but hegrenade works like the C4.. it does damage to specific radius so maybe that's why DMG_BLAST is used there... ?
I am sorry if I am talking bullshits! Tho I'd like to know why HE damage is ( 1 << 24 )... why 24 not 20 for example, where should I see those values? |
Re: Grenade damage from Ham_TakeDamage
Because 20 is already used/
#define DMG_ACID (1<<20) // Toxic chemicals or acid burns |
Re: Grenade damage from Ham_TakeDamage
Thanks, will try to understand it. :)
Edit: I think I got it, I've just seen them in hlsdk_const.inc, but I am still little confused, what will happen if I put different value than 24 and why 24 is HE grenade's damage not m4a1's for example ? |
Re: Grenade damage from Ham_TakeDamage
Its the way the DamageBits are sent. Each damage has a bitsum of damages that all equal up to what's going on with the damage delt. For example knife damage is (DMG_BULLET | DMG_NEVERGIB) and so on. Grenades do a different damage than a bullet. So it has a different bit quantity. etc etc. Not fully sure how the core handles it, but that's what's going on there.
|
Re: Grenade damage from Ham_TakeDamage
Quote:
|
Re: Grenade damage from Ham_TakeDamage
HEGrenades use their own damage type
Code:
#define DMG_HEGRENADE ( 1 << 24 ); |
| All times are GMT -4. The time now is 05:47. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.