I have a SetSwingDoorClosed problem please help.
I'm trying to make it so when they walk in an area the doors will be open before they can see them. Then when they get close to them I want all the doors to slam and lock except for one (door9). Here is my script any help would be very appreciated.
void OnStart()
{
AddEntityCollideCallback("Player", "CloseDoors", "CloseDoors", true, 1);
AddEntityCollideCallback("Player", "OpenDoors", "OpenDoors", true, 1);
//("Player", "Area", "Func", Disable?, 1 0 -1)
}
void OpenDoors(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door1", false, false);
SetSwingDoorClosed("door2", false, false);
SetSwingDoorClosed("door3", false, false);
SetSwingDoorClosed("door4", false, false);
SetSwingDoorClosed("door5", false, false);
SetSwingDoorClosed("door6", false, false);
SetSwingDoorClosed("door7", false, false);
SetSwingDoorClosed("door8", false, false);
SetSwingDoorClosed("door9", false, false);
}
void CloseDoors(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door1", true, true);
SetSwingDoorClosed("door2", true, true);
SetSwingDoorClosed("door3", true, true);
SetSwingDoorClosed("door4", true, true);
SetSwingDoorClosed("door5", true, true);
SetSwingDoorClosed("door6", true, true);
SetSwingDoorClosed("door7", true, true);
SetSwingDoorClosed("door8", true, true);
SetSwingDoorLocked("door1", true, true);
SetSwingDoorLocked("door2", true, true);
SetSwingDoorLocked("door3", true, true);
SetSwingDoorLocked("door4", true, true);
SetSwingDoorLocked("door5", true, true);
SetSwingDoorLocked("door6", true, true);
SetSwingDoorLocked("door7", true, true);
SetSwingDoorLocked("door8", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
// end
void OnEnter()
{
}
// end
void OnLeave()
{
}
// end
(This post was last modified: 07-08-2012, 06:04 PM by Atilla280.)
|