machosalad
Junior Member
Posts: 38
Threads: 8
Joined: Oct 2010
Reputation:
0
|
Play sound only ONCE
I am using this script to play a sound when player collides with an area:
void OnStart()
{
AddEntityCollideCallback("Player", "Area1", "PlaySound1", false, 0);
}
void AreaSound1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("","amb_alert.snt", "mansion_1", 0, false);
}
However it plays the sound everytime the player enters or leaves the area! How do i make it play only once?
|
|
11-09-2010, 05:35 PM |
|
Som1Lse
Member
Posts: 183
Threads: 9
Joined: Sep 2010
Reputation:
0
|
RE: Play sound only ONCE
Use this instead:
AddEntityCollideCallback("Player", "Area1", "PlaySound1", true, 0);
|
|
11-09-2010, 05:51 PM |
|
machosalad
Junior Member
Posts: 38
Threads: 8
Joined: Oct 2010
Reputation:
0
|
RE: Play sound only ONCE
(11-09-2010, 05:51 PM)Someone else Wrote: Use this instead:
AddEntityCollideCallback("Player", "Area1", "PlaySound1", true, 0);
Thanks it worked perfectly!
|
|
11-09-2010, 05:57 PM |
|
DamnNoHtml
Senior Member
Posts: 469
Threads: 34
Joined: Sep 2010
Reputation:
16
|
RE: Play sound only ONCE
Just so you can learn from it,
AddEntityCollideCallback("Player", "Area1", "PlaySound1", false, 0);
That 'false' refers to "Delete once encountered?"
Creator of Wake, Through the Portal, Insomnia, and Cycles What to do with HPL3....
(This post was last modified: 11-09-2010, 10:22 PM by DamnNoHtml.)
|
|
11-09-2010, 10:22 PM |
|
|