Molotov_Detonate(iEntity)
{
if(is_nullent(iEntity)) return
new Float:flFraction, Float:vecEnd[3], Float:vecOrigin[3]
get_entvar(iEntity, var_origin, vecOrigin)
vecEnd = vecOrigin
vecEnd[2] -= 64.0
engfunc(EngFunc_TraceLine, vecOrigin, vecEnd, IGNORE_MONSTERS, iEntity, 0)
get_tr2(0, TR_flFraction, flFraction)
new Buffer[64]
if(flFraction >= 1.0)
{
TE_SetupExplosion(vecOrigin, Float:{ 0.0, 0.0, 20.0 }, g_iModelIndex[1], 20, 15, TE_EXPLFLAG_NOSOUND | TE_EXPLFLAG_NOPARTICLES)
TE_SetupExplosion(vecOrigin, Float:{ 0.0, 0.0, 20.0 }, g_iModelIndex[0], 20, 15, TE_EXPLFLAG_NOSOUND | TE_EXPLFLAG_NOPARTICLES)
ArrayGetString(SaveSound, 0, Buffer, charsmax(Buffer))
rh_emit_sound2(iEntity, 0, CHAN_WEAPON, Buffer, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
destroyNade(iEntity)
return
}
new iOwner = get_entvar(iEntity, var_owner)
new Float:vecEndPos[3]
new Float:vecPlaneNormal[3]
get_tr2(0, TR_vecEndPos, vecEndPos)
get_tr2(0, TR_vecPlaneNormal, vecPlaneNormal)
Molotov_CreateDebris(iOwner, vecEndPos)
Buffer[0] = EOS
ArrayGetString(SaveSound, 1, Buffer, charsmax(Buffer))
rh_emit_sound2(iEntity, 0, CHAN_WEAPON, Buffer, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
destroyNade(iEntity)
}