View Single Post
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-04-2011 , 09:10   Re: HE Explosions Destroy Breakables
Reply With Quote #7

To detect HE grenade explosion, there are not much ways :

Using Orpheu :

- Hooking CGrenade::Detonate3() or CGrenade::Explode3() : The most efficient/reliable method.

Without Orpheu :

- Checking exploding time with pev_dmgtime by hooking "grenade" think. Method is acceptable, though forward will be called until the grenade dies, not cool.
- Using grenade_throw forward, setting a set_task or next think of a dummy entity, to (pev_dmgtime - gametime) seconds. Not a good way, because we don't know if the grenade has really exploded.
- Hooking TE_EXPLOSION (There is 2 messages) with register_event (SVC_TEMPENTITY). "1=3" "6=25" "7=30" "8=0". Not a good way since you need the grenade entity index and it could be thrown for another purpose.
- Using grenade_throw forward, hooking FM_EmitSound, checking "weapons/debris1.wav" + "weapons/debris2.wav" + "weapons/debris3.wav" + checking the grenade is well a grenade and unregistering FM_EmitSound. Not bad.

Of course, I would use Orpheu. :mrgreen:
Without Orpheu, between, dmgtime and emitsound, I guess the latter would fairly good.
__________________
Arkshine is offline