bartimeus
Junior Member
Posts: 20
Threads: 6
Joined: Jun 2012
Reputation:
0
|
PlaySoundAtEntity doesn't work
Hi
I tried to make a script which is supposed to play a sound near the player when he pick up a key.
Here's the script:
void OnStart()
{
SetEntityPlayerInteractCallback("keyhouse", "bruit", true);
}
void bruit(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound)
{
PlaySoundAtEntity("", "hit_wood", "areabruit", 0, false);
PlaySoundAtEntity("", "attack_launch", "areabruit", 0, false);
}
The problem is that I can't hear any noise. I tried adding .snt at the end of the files, I tried to replace areabruit with a box or a door, and I still can't hear anything.
(This post was last modified: 06-19-2012, 09:38 PM by bartimeus.)
|
|
06-19-2012, 06:50 PM |
|
i3670
Posting Freak
Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation:
36
|
RE: PlaySoundAtEntity doesn't work
You got the wrong syntax
The correct one is:
void MyFunc(string &in asEntity)
|
|
06-19-2012, 06:59 PM |
|
bartimeus
Junior Member
Posts: 20
Threads: 6
Joined: Jun 2012
Reputation:
0
|
RE: PlaySoundAtEntity doesn't work
well... Thanks. I think I still need to learn with the callback syntax.
|
|
06-19-2012, 07:08 PM |
|
i3670
Posting Freak
Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation:
36
|
RE: PlaySoundAtEntity doesn't work
If you're using the wiki page there's usually a text in bold below when its about callbacks e.g. collide, interact etc.
(This post was last modified: 06-19-2012, 07:10 PM by i3670.)
|
|
06-19-2012, 07:10 PM |
|