GetLocked

From NWN Lexicon
Jump to navigationJump to search



GetLocked(object)

Check whether a given object is locked.

int GetLocked(
    object oTarget
);

Parameters

oTarget

The object to check.


Description

Returns a true/false value indicating whether or not oTarget is locked. Returns TRUE if oTarget is locked. Returns FALSE if oTarget is not locked. There is no error value.



Version

1.22

Example

// This will check whether the object "chest" is locked or unlocked
void main()
{
    object a;
    a = GetObjectByTag("chest");
    if(GetLocked(a))    //Is the chest locked?
        SendMessageToPC(GetFirstPC(),"This is Locked");
    if(!GetLocked(a))   //Is the chest Unlocked?
        SendMessageToPC(GetFirstPC(),"This is Unlocked");
}

See Also

functions: 

GetLockLockable



 author: GoLeM, editor: Kristian Markon