bomb_explode() is sent when
#Target_Bomb message is detected.
When the bomb timer is finished,
CGrenade::Detonate2() (called from
CGrenade::C4Think()) calls
CGrenade::Explode2(). Inside, it calls
CBaseMonster::RadiusDamage().
#Target_Bomb is fired in
CHalflifeMultiplay::CheckWinConditions().
So, basically : Timer ends -> Explosion -> Radius damage -> Scoring -> End message.
bomb_explode() is called after the damage done, so it can't work using this forward.
Without using Orpheu, it could be possible to hook svc_tempentity or ScreenShake but for the most reliable way would be to hook
CGrenade::Detonate2() or
CGrenade::Explode2().
Using Orpheu, I would use
CGrenade::Detonate2(), because this function is exported by default thus giving a symbol name which is more reliable than making a signatures of bytes.
So :
Code:
#include <amxmodx>
#include <orpheu>
public plugin_init()
{
OrpheuRegisterHook( OrpheuGetFunction( "Detonate2", "CGrenade" ), "CGrenade_Detonate2" );
}
public CGrenade_Detonate2()
{
log_amx( "CGrenade::Detonate2() called." );
}
and the signature, you need to create a file named "
Detonate2" in "
orpheu/functions/CGrenade" with this content :
Code:
{
"name" : "Detonate2",
"class" : "CGrenade",
"library" : "mod",
"identifiers" :
[
{
"os" : "windows",
"mod" : "cstrike",
"value" : "?Detonate2@CGrenade@@QAEXXZ"
},
{
"os" : "linux",
"mod" : "cstrike",
"value" : "Detonate2__8CGrenade"
}
]
}
__________________