generated from Jaysyn/ModuleTemplate
Initial commit
Initial commit
This commit is contained in:
27
_module/nss/k_locker.nss
Normal file
27
_module/nss/k_locker.nss
Normal file
@@ -0,0 +1,27 @@
|
||||
// This script locks OBJECT_SELF at night and unlocks it during the day.
|
||||
//
|
||||
// ============================================================================
|
||||
// Part of the "Aspire" module foundation package.
|
||||
// Author: Kaylor
|
||||
// ============================================================================
|
||||
void main()
|
||||
{
|
||||
if (GetLocalInt(OBJECT_SELF, "Aspire_LockerTimeStamp") != GetTimeHour()){
|
||||
|
||||
// Lock the object at night
|
||||
if (GetIsNight() == TRUE){
|
||||
if (GetLocked(OBJECT_SELF) == FALSE){
|
||||
SetLocked(OBJECT_SELF, TRUE);
|
||||
SetLocalInt(OBJECT_SELF, "Aspire_LockerTimeStamp", GetTimeHour());
|
||||
}
|
||||
}
|
||||
|
||||
// Unlock it during the day.
|
||||
else {
|
||||
if (GetLocked(OBJECT_SELF) == TRUE){
|
||||
SetLocked(OBJECT_SELF, FALSE);
|
||||
SetLocalInt(OBJECT_SELF, "Aspire_LockerTimeStamp", GetTimeHour());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user