The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
can't stop looping sound!
nekrodamus Offline
Junior Member

Posts: 8
Threads: 3
Joined: Jan 2011
Reputation: 0
#1
can't stop looping sound!

Is there a way a sound plays only once when a player collides with an area?
I play it when he collides, but it continues looping endlessly... i have to set a timer to cut it off... Is there a more direct way?
This is the Onstart code:
void OnStart()
{
    AddEntityCollideCallback("Player", "ScriptArea_2", "OnEnterArea2", true, 1);
}
This is the Script area code:
void OnEnterArea2(string &in asParent, string &in asChild, int alState)
{
    PlaySoundAtEntity("cuiqui", "scare_scratch.snt", "Player", 1.0f, false);
    AddTimer("sonido01", 5, "TimerFinSonido01");
}
And the timer that stops the sound...
void TimerFinSonido01(string &in asTimer)
{
    StopSound("cuiqui", 6.0f);
}
But set a timer for each sound i play is a little annoying...Sad
01-20-2011, 07:05 AM
Find


Messages In This Thread
can't stop looping sound! - by nekrodamus - 01-20-2011, 07:05 AM
RE: can't stop looping sound! - by Equil - 01-20-2011, 07:25 AM
RE: can't stop looping sound! - by Tottel - 01-20-2011, 07:25 AM
RE: can't stop looping sound! - by nekrodamus - 01-20-2011, 07:51 AM
RE: can't stop looping sound! - by Tanshaydar - 01-20-2011, 12:39 PM



Users browsing this thread: 3 Guest(s)