Two problems here.
First is at the void DOORopenSOUND. There should have been the callback syntax. Because the function used was AddUseItemCallback, use (string &in asItem, string &in asEntity) as it's callback.
Second is at the SetLevelDoorLockedSound function. You need to fill the parameters in. Like what asName is, what asSound is, etc. You're also missing a semicolon.
And that's it.
OR!
Ignore everything I said above and just copy-paste the script below.
(12-24-2014, 12:43 PM)Headless Wrote: Oh i screwed up kinda, sorry.
What i wanted is when you try to open this door.
Another door slammed open.
Oh, like uh..
You have two doors, both locked. On the left is Door A and on the right is Door B. If you interact with Door B, nothing happens. But if you try to pull or push Door A, Door B will slam open, is that what you mean?
void TimerStopSound(string &in asTimer)
{
StopSound("SlammingSound", 0.4);
}
I think im closer but im lost again
Yes exactly that!
DoorOpenSlamming>DoorB ..........................................Doorlocked>DoorA
----------------------------------------------------------------------------00000--
0
0
0
---------------------------------------------------------------------------00000--
.................................................................................................Door:Where you enter the room
(This post was last modified: 12-24-2014, 02:05 PM by Headless.)
void DoorCheck() { if(GetLocalVarInt("DoorVar") == 10) //Indicates you have to interact with it ten(10) times { AddTimer("Slam", 2.75f, "Slam"); } }
void Slam(string &in asTimer) { SetSwingDoorLocked("Door_B", false, false); AddPropForce("Door_B", 0, 0, 0, "World"); //Change the Z or X argument (X is the first zero, Z is the last zero) to fit your door's alignment }
That's my take on this. Untested. If something doesn't fit what you want, go ahead and give me a PM.
void DoorCheck()
{
if(GetLocalVarInt("DoorVar") == 10) //Indicates you have to interact with it ten(10) times
{
AddTimer("Slam", 2.75f, "Slam");
}
}
void Slam(string &in asTimer)
{
SetSwingDoorLocked("Door_B", false, false);
AddPropForce("Door_B", -1, 0, 0, "World"); //Change the Z or X argument (X is the first zero, Z is the last zero) to fit your door's alignment
}
Maybe i think i didnt put it in right but not sure how to do it
Sorry im kinda new to scripting and mostly use tutorials and trail and error.
(This post was last modified: 12-24-2014, 02:25 PM by Headless.)
void DoorCheck() { if(GetLocalVarInt("DoorVar") == 10) //Indicates you have to interact with it ten(10) times { AddTimer("Slam", 2.75f, "Slam"); } }
void Slam(string &in asTimer) { SetSwingDoorLocked("Door_B", false, false); AddPropForce("Door_B", -1, 0, 0, "World"); //Change the Z or X argument (X is the first zero, Z is the last zero) to fit your door's alignment }
Corrected.
Here's a lesson.
Spoiler below!
ALL FUNCTIONS MUST EXIST IN A CALLBACK FUNCTION. So stuff like SetSwingDoorLocked or AddTimer must be inside things like: