Space Engineers

Space Engineers

评价数不足
Dawese Safe Block
   
奖励
收藏
已收藏
取消收藏
Type: Mod
Mod category: Block
标签: ServerScripts
文件大小
发表于
更新日期
1.618 MB
11 月 18 日 上午 9:39
11 月 18 日 上午 9:50
2 项改动说明 ( 查看 )

订阅以下载
Dawese Safe Block

描述
Description
This block allows you to put items into a safe and securing them with a password!


Core features
  • Small grid safe block.
  • Persistent numeric password.
  • Lockable inventory.
  • API for another mods.


How to lock a block
Just type in the password you want to set and click the lock button.


How to unlock a block
Just type in the correct password which was set and click the unlock button.


API
using ProtoBuf; using Sandbox.ModAPI; namespace Dawese_Safe_Block { public static class DaweseSafeBlockApi { /// <summary> /// Locks the safe block if it exists. /// </summary> /// <param name="safeBlockEntityId">The entity id of the safe block to lock.</param> /// <param name="password">The password to use.</param> public static void forceLockSafeBlockWithPassword(long safeBlockEntityId, string password) { MessageSender.sendToServer( MESSAGE_ID_LOCK_OR_UNLOCK_SAFE_WITH_PASSWORD_API, MyAPIGateway.Utilities.SerializeToBinary(new LockSafeWithPasswordApiMessage() { safeBlockEntityId = safeBlockEntityId, password = password, lockTheBlock = true })); } /// <summary> /// Unlocks the safe block if it exists. /// </summary> /// <param name="safeBlockEntityId">The entity id of the safe block to unlock.</param> public static void forceUnlockSafeBlock(long safeBlockEntityId) { MessageSender.sendToServer( MESSAGE_ID_LOCK_OR_UNLOCK_SAFE_WITH_PASSWORD_API, MyAPIGateway.Utilities.SerializeToBinary(new LockSafeWithPasswordApiMessage() { safeBlockEntityId = safeBlockEntityId, password = "", lockTheBlock = false })); } //============================================================================= // DEAR DEVELOPERS, DON'T TOUCH THE CODE BELOW THIS COMMENT. //============================================================================= private const ushort MESSAGE_ID_LOCK_OR_UNLOCK_SAFE_WITH_PASSWORD_API = 38744; [ProtoContract] public class LockSafeWithPasswordApiMessage { [ProtoMember(1)] public long safeBlockEntityId; [ProtoMember(2)] public string password; [ProtoMember(3)] public bool lockTheBlock; } } }


Mod License Terms
1. Usage Rights
  • The use of this mod is permitted under the conditions of this license.
2. Restrictions
  • No Reupload:
    It is not allowed to reupload this mod, neither in its original nor in a modified form.
  • No False Authorship:
    This mod may not be claimed as your own work.
  • Integration into Other Mods:
    If this mod is integrated into or used as part of another mod, the original creator must be clearly credited and linked.
  • Intellectual Property:
    The entire content of this mod is and remains the intellectual property of the original creator.
  • No Commercial Use:
    It is not allowed to make money in any way using this mod.
  • Content Utilization:
    Any utilization of the contents of this mod is only permitted if explicitly acknowledged. The original creator remains the intellectual property owner of this API as well.
3. Disclaimer
  • This mod is provided without any warranties. The creator is not liable for any damages that may arise from its use.
---
© [2025] [Dawese / not4you403 / clickbait_virus]