51 lines
1.1 KiB
Plaintext
51 lines
1.1 KiB
Plaintext
//::////////////////////////////////////////////////////////////////////////////
|
|
//::
|
|
//:: Script Name: doorclose
|
|
//::
|
|
//:: Use: Closes a door after specified amount of time in the door variables,
|
|
//:: default is 15 seconds. Also, if the builder doesn't want the door
|
|
//:: to ever close, just put a -1 as the variable name in the door properties.
|
|
//::
|
|
//:: Created By: Birdman076
|
|
//::
|
|
//:: Created On: Aug 20, 2009
|
|
//::
|
|
//:: Updated On: Aug 27, 2011
|
|
//::
|
|
//:: Note: Optional variable on the door placeable string sClose - Time to close
|
|
//:: door, in same format of a float (xx.x)
|
|
//::
|
|
//::
|
|
//::
|
|
//::
|
|
//::
|
|
//::
|
|
//::
|
|
//::////////////////////////////////////////////////////////////////////////////
|
|
void main()
|
|
{
|
|
object oDoor = OBJECT_SELF;
|
|
float fClose;
|
|
string sClose = GetLocalString( OBJECT_SELF, "sClose" );
|
|
|
|
if( sClose == "" )
|
|
{
|
|
fClose = 15.0;
|
|
}
|
|
else if( sClose == "-1" )
|
|
{
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
fClose = StringToFloat( sClose );
|
|
}
|
|
|
|
DelayCommand( fClose, ActionCloseDoor(oDoor) );
|
|
|
|
if ( GetLockLockable( oDoor ) )
|
|
{
|
|
SetLocked( oDoor, TRUE );
|
|
}
|
|
}
|