Frictional Games Forum (read-only)

Full Version: which signature shall i have on "PlayMusic" pls help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i am new to scripting. so i tried to solve this by my own but i couldn't. so i thought other eyes and those who have more experience could help me out. Here is my script


void OnStart()
{
AddEntityCollideCallback("Player", "FlyingJesus_1", "HolyJesus", true, 1);
AddEntityCollideCallback("Jesus_1", "FlyingJesus_1", "Sound", true, 1);
AddEntityCollideCallback("Player", "Hanging", "Hang", true,1);
AddEntityCollideCallback("Hagingman", "Hanging", "Soound", true, 1);
AddEntityCollideCallback("Player", "Music", "StartMusic", true, 1);
}

void StartMusic(string &in asParent, string &in asChild, int alState)
{
PlayMusic("general_rain.ogg", true, 0.8, 2, 1, true);
}

void HolyJesus(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Jesus_1", true);
AddPropForce("Jesus_1", 0, 0, 0, "World");
}

void Sound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "24_iron_maiden.snt", "FlyingJesus_1", 0, false);
}

void Hang(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Hagingman", true);
}

void Soound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "24_iron_maiden.snt", "Hanging", true, 1);
}

void OnLeave()
{
}
Isn't general_rain.ogg in the "sounds" folder? In that case, use PlaySoundAtEntity.