generated from Jaysyn/ModuleTemplate
33 lines
850 B
Plaintext
33 lines
850 B
Plaintext
// Auto close door and lock door
|
|
// based on ints stored on the object.
|
|
// Defaults to 15 seconds.
|
|
// Note: for transitions, both doors need to have
|
|
// this script and nClose needs to be the same.
|
|
|
|
void main()
|
|
{
|
|
int dBug = FALSE;
|
|
object oDoor = OBJECT_SELF;
|
|
int nClose = GetLocalInt(oDoor, "nClose");
|
|
int nLockup = GetLocalInt(oDoor, "nLockup");
|
|
|
|
if(nClose == 0)
|
|
nClose = 3; // Default delay
|
|
|
|
// if(nClose)
|
|
// {
|
|
float fClose = IntToFloat(nClose);
|
|
float fLock = fClose + 0.5 ;
|
|
|
|
DelayCommand(fClose,ActionCloseDoor(oDoor));
|
|
|
|
if(nLockup > 0)
|
|
DelayCommand(fLock,SetLocked(oDoor, TRUE));
|
|
// }
|
|
|
|
if(dBug)
|
|
WriteTimestampedLogEntry(GetTag(oDoor) + " - nClose is " + IntToString(nClose) + "\n" +
|
|
"nLockup is " + IntToString(nLockup));
|
|
}
|
|
|