Space Engineers

Space Engineers

Not enough ratings
[Dawese] Safe Block
   
Award
Favorite
Favorited
Unfavorite
Type: Mod
Mod category: Block
File Size
Posted
Updated
1.618 MB
Nov 18 @ 9:39am
Nov 18 @ 9:50am
2 Change Notes ( view )

Subscribe to download
[Dawese] Safe Block

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

Primary use case
Primarily made for the mod [Dawese] Roleplay Missions.



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) { MyAPIGateway.Multiplayer.SendMessageToServer( 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) { MyAPIGateway.Multiplayer.SendMessageToServer( 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]