//env_explotion
#define SF_ENVEXPLOSION_NODAMAGE 0x00000001 // when set, ENV_EXPLOSION will not actually inflict damage
#define SF_ENVEXPLOSION_REPEATABLE 0x00000002 // can this entity be refired?
#define SF_ENVEXPLOSION_NOFIREBALL 0x00000004 // don't draw the fireball
#define SF_ENVEXPLOSION_NOSMOKE 0x00000008 // don't draw the smoke
#define SF_ENVEXPLOSION_NODECAL 0x00000010 // don't make a scorch mark
#define SF_ENVEXPLOSION_NOSPARKS 0x00000020 // don't make sparks
#define SF_ENVEXPLOSION_NOSOUND 0x00000040 // don't play explosion sound.
#define SF_ENVEXPLOSION_RND_ORIENT 0x00000080 // randomly oriented sprites
#define SF_ENVEXPLOSION_NOFIREBALLSMOKE 0x0100
#define SF_ENVEXPLOSION_NOPARTICLES 0x00000200
#define SF_ENVEXPLOSION_NODLIGHTS 0x00000400
#define SF_ENVEXPLOSION_NOCLAMPMIN 0x00000800 // don't clamp the minimum size of the fireball sprite
#define SF_ENVEXPLOSION_NOCLAMPMAX 0x00001000 // don't clamp the maximum size of the fireball sprite
#define SF_ENVEXPLOSION_SURFACEONLY 0x00002000 // don't damage the player if he's underwater.
stock DoExplosion(Float:vPos[3], iAtker = 0, iInflictor = -1, iIgnoreEntity = -1, iDamage = 0, iRadius = 146, iFlags = 0, Float:flDmgForce = 0.0, const String:szWepName[] = "")
{
new iExplosion = CreateEntityByName("env_explosion");
if (IsValidEntity(iExplosion))
{
//DispatchKeyValue(iExplosion, "rendermode", "5");
//DispatchKeyValue(iExplosion, "fireballsprite", "spirites/zerogxplode.spr");
if (iAtker != -1) // Suggested to make it a player or his weapon
{
SetEntPropEnt(iExplosion, Prop_Data, "m_hOwnerEntity", iAtker);
}
if (iInflictor != -1)
{
SetEntPropEnt(iExplosion, Prop_Data, "m_hInflictor", iInflictor);
}
if (iIgnoreEntity != -1)
{
SetEntPropEnt(iExplosion, Prop_Data, "m_hEntityIgnore", iIgnoreEntity);
}
SetEntProp(iExplosion, Prop_Data, "m_iMagnitude", iDamage);
SetEntProp(iExplosion, Prop_Data, "m_iRadiusOverride", iRadius);
DispatchKeyValueInt(iExplosion, "spawnflags", iFlags);
if (flDmgForce > 0.0)
{
DispatchKeyValueFloat(iExplosion, "DamageForce", flDmgForce);
}
if (szWepName[0] != '\0')
{
DispatchKeyValue(iExplosion, "classname", szWepName);
// if (iInflictor != -1)
// {
// DispatchKeyValue(iInflictor, "classname", szWepName);
// }
}
TeleportEntity(iExplosion, vPos, NULL_VECTOR, NULL_VECTOR);
DispatchSpawn(iExplosion);
//ActivateEntity(iExplosion);
AcceptEntityInput(iExplosion, "Explode");
if (~iFlags & SF_ENVEXPLOSION_REPEATABLE)
{
AcceptEntityInput(iExplosion, "Kill");
}
return iExplosion;
}
return -1;
}