Page MenuHomeFeedback Tracker

[Feature Request] New scripting command: lockContainer
Acknowledged, WishlistPublic

Description

I presume this has been asked in the past in some form or another (even by me, hence decided to edit the ancient entry):
There still seems to be no way to lock any container (as in ammobox, etc). You can of course block inventory access with the container events but you can not get rid of the "Take XYZ", "Inventory" etc actions that appear.
Disabling simulation has not effect, locking a vehicle still leaves it's container wide open..

Sometimes you just want a simulated weaponholder without the actions appearing, etc.

<container> lockContainer <bool>
<container> lockContainer [<bool>, [<units>]]
  • first syntax just lockContainer true/false for given container
  • second syntax would issue the lockContainer state to given units only
if (player getVariable ["i_has_key", false]) then {
     _safe addAction ["Unlock safe", {(_this # 0) enableContainer true}];
};
_box1 enableContainer [
    false,
    (call BIS_fnc_listPlayers) select {side _x == east}
];
private _container = createVehicle ["WeaponHolderSimulated", [0, 0, 0], [], 0, "CAN_COLLIDE"];
_container addWeaponCargoGlobal [_wep, 1];
_container lockContainer true;
_container setPos (player getRelPos [2, 90]);

Details

Legacy ID
646465192
Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 7
Category
Engine

Event Timeline

h- set Category to Feature Request.Aug 27 2015, 7:30 AM
h- set Reproducibility to N/A.
h- set Severity to None.
h- set Resolution to Open.
h- set Legacy ID to 646465192.May 8 2016, 12:34 PM
h- renamed this task from add scripting command "enableContainer" to [Feature Request] New scripting command: lockContainer.Fri, Jul 31, 8:40 AM
h- updated the task description. (Show Details)
h- set Operating System to Windows 7.
h- changed Category from Feature Request to Engine.