<container/object> enableContainer <bool>
- There're items and stuff that can be useful for mission design but they include a weaponholder (like the placeable itemsI 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, backpacks and weapons) and sometimes you may only want the model to show without being able to pick them up so a command to disable the container would be nice (also retaining the possibility to re-enable it)..
- I guess you can do this by 'enablesimulation falsing' the container but it still shows the action icon and the action is workingetc). You can of course block inventory access with the container events but you can not get rid of the "Take XYZ", activating the action makes the unit play the take anim even though nothing is taken from the container..
- Example: _radio = "Item_ItemRadio" createVehicle (getPosASL player);"Inventory" etc actions that appear.
Disabling simulation has not effect, _radio enableContainer false;locking a vehicle still leaves it's container wide open..
Sometimes you just want a simulated weaponholder without the actions appearing, //'dud' radio on ground..
- Example: {(backpaetc.
```
<container> lockContainer _x) enableC<bool>
<container false} forEach (units group player);> lockContainer [<bool>, //locks up player group's backpacks (for whatever reason)
- Example: _wep = "Weapon_srifle_DMR_02_F" createVehicle (position _displayCase);[<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", _wep enableContainer false;false]) then {
_safe addAction ["Unlock safe", _wep attachTo [_displayCase,{(_this # 0) enableContainer true}];
};
```
```
_box1 enableContainer [
false,
(call BIS_fnc_listPlayers) select {side _x == east}
];
```
```
private _container = createVehicle ["WeaponHolderSimulated", [0, 0, 0], [], 0,0]]; "CAN_COLLIDE"];
_container addWeaponCargoGlobal [_wep, //look but don't pick up..1];
_container lockContainer true;
_container setPos (player getRelPos [2, 90]);
```