Frictional Games Forum (read-only)

Full Version: Play Sound on area
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, i have made a script, for playing a sound at a piano, when i walk into an area.
But when i try it the game crashes..

what have i done wrong?
heres the script :

// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "bitch", true, 1);
}


void bitch(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);
{
PlaySoundAtEntity("knuppel", "general_piano03.snt", "piano_1", 2.0f, false);
StopSound("knubbel", 5.0f);
}

i hope for help Huh
Error information please!
void bitch(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);

should be

void bitch(string &in asParent, string &in asChild, int alState)

then it might work
(12-12-2010, 12:28 PM)jens Wrote: [ -> ]void bitch(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);

should be

void bitch(string &in asParent, string &in asChild, int alState)

then it might work

cool, thank you for fast answer. it works great Smile
but why was my void wrong?
You used the wrong syntax for CollideCallbacks.