11-09-2010, 05:35 PM
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?
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?