Code Locks

Have you ever wanted to secure objects with code locks in Unturned? Using this plugin, players can add code locks to doors and storages - providing access to anyone who knows the code.


Images

image


Usage

Simply lock a door/storage using the /lock command. From here, other players can walk up to the object and attempt to use it. A keypad will pop up prompting for the code. Clicking anywhere on the screen except the keypad will close it.

By default, each incorrect attempt will deal a bit more damage each time, until the player is killed.


Commands

Command Syntax Explanation Example
/lock code Adds a code lock to an object, or changes if one already exists /lock 2344
/unlock Removes the code lock from an object /unlock

Configuration

<?xml version="1.0" encoding="utf-8"?>
<CodeLocksConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <RememberOwner>true</RememberOwner>
  <RememberUsers>true</RememberUsers>
  <NonOwnerCanChangeCode>true</NonOwnerCanChangeCode>
  <OnlyOwnerCanLock>false</OnlyOwnerCanLock>
  <Effects>
    <UI>29123</UI>
    <Success>29124</Success>
    <Failure>29125</Failure>
  </Effects>
  <Attempts>
    <Cooldown>60</Cooldown>
    <Damages>
    <Damage>0</Damage>
    <Damage>30</Damage>
    <Damage>50</Damage>
    <Damage>255</Damage>
    </Damages>
  </Attempts>
</CodeLocksConfiguration>

Translatation

<?xml version="1.0" encoding="utf-8"?>
<Translations xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Translation Id="commands_codelock_help" Value="/lock &lt;code&gt; - Adds a code lock to an object, or changes if one already exists." />
  <Translation Id="invalid_parameters" Value="&lt;color=red&gt;Invalid parameters.&lt;/color=red&gt;" />
  <Translation Id="commands_codelock_no_lockable_object" Value="&lt;color=red&gt;You are not looking at a lockable object.&lt;/color&gt;" />
  <Translation Id="commands_codelock_invalid_code" Value="&lt;color=red&gt;The given code ({0}) is invalid. The code must be four numbers (ex. 1234).&lt;/color&gt;" />
  <Translation Id="commands_codelock_code_added" Value="This object has been locked with the code {0}." />
  <Translation Id="commands_codelock_code_changed" Value="This object's lock has been changed to the code {0}." />
  <Translation Id="commands_codelock_code_removed" Value="This object's has been unlocked." />
  <Translation Id="commands_codelock_no_access" Value="&lt;color=red&gt;You do not have access to set this object's locks.&lt;/color&gt;" />
  <Translation Id="commands_codelock_no_code" Value="&lt;color=red&gt;There is no code lock on this object.&lt;/color&gt;" />
</Translations>