Determine a grenades origin at explosion AND the owner
Is this possible?
I want to determine the origin of where the grenade explodes, but I also want to determine the owner and how much damage it dealt. I could catch the effect that is thrown when it explodes, but then I can't query that ent ID (to get the owner) b/c it will have been destroyed. Any ideas? Thanks, Josh |
I do not see any problem here.
AFAIR, grenade entity exist at explosion. I believe all what you asked is possible. |
VEN: While he did only ask if it was possible, I think he was really asking how he would go about doing it.
|
Maybe hook the explosion sound with FM_EmitSound? Dunno :o
|
Well one thing I just thought of... The damage event also passes coords so that arrows can be drawn on the screen and indicate to the player which direction the damage came from.
I wonder if that coord would be the origin of the grenade explosion... I'm going to test this :P |
counter-strike grenades are a mystery!
Code:
you'll have to filter out c4 from this (they are considered grenades), but other than that it should alert one "think" (< 0.1 second) before a grenade explodes. you should also be able to grab EV_ENT_owner as usual. |
Thanks, that will occur before the on_damage event right?
Also, how would I link the amount of damage done back to that function? |
it will occur before damage. you can't tell how much damage is done, all this does is hook right before the grenade explodes. offset 118 changes from 0 to 1 the think prior to explosion.
|
I believe that better catch the explosion sound as v3x said, because it indicates exact the moment of explosion.
Kraugh's method seems less precise since grenades thinks not instantly but with something like 0.1sec delay. Here is grenades explosion sound list: Code:
HE Grenade |
Code:
|
| All times are GMT -4. The time now is 20:19. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.