A_StopSound

From ZDoom Wiki
Jump to: navigation, search

A_StopSound [(int slot)]

  • slot can be an integer between 0 and 7, or one of the following constants:
    CHAN_AUTO
    CHAN_WEAPON
    CHAN_VOICE (the default, for historical reasons)
    CHAN_ITEM
    CHAN_BODY


Stops the current sound playing.

Examples

ACTOR ImpFireBall : DoomImpBall
{
       States
       {
       Spawn:
               BAL1 A 0 NoDelay A_PlaySound("Fireball/Loop", 6, 1, TRUE)
               BAL1 AB 4 Bright
               Loop
       Death:
               BAL1 C 0 A_StopSound(6)
               BAL1 CDE 6 Bright
               Stop
       }
}

This new fireball plays a loop sound when it spawns, and when it comes to "Death" state, it stops the sound and the projectile explodes.

Sounds are not included by default, and if you want to add this to a mod, please remember that you have to spawn it by yourself when an imp throws it.

See also