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]);