2015-08-31 06:08:30 +00:00
|
|
|
/*
|
2015-09-05 03:40:00 +00:00
|
|
|
DMS_fnc_SpawnCrate
|
2015-08-31 06:08:30 +00:00
|
|
|
Created by eraser1
|
|
|
|
|
|
|
|
Usage:
|
|
|
|
[
|
|
|
|
_crateClassName,
|
|
|
|
_pos
|
2015-09-05 03:40:00 +00:00
|
|
|
] call DMS_fnc_SpawnCrate;
|
2015-08-31 06:08:30 +00:00
|
|
|
Returns crate object
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private ["_crateClassName", "_pos", "_crate"];
|
|
|
|
|
|
|
|
_OK = params
|
|
|
|
[
|
|
|
|
["_crateClassName","ERROR",[""]],
|
|
|
|
["_pos","ERROR",[[]],[3]]
|
|
|
|
];
|
|
|
|
|
|
|
|
if (!_OK) then
|
|
|
|
{
|
|
|
|
diag_log format ["DMS ERROR :: Calling DMS_SpawnCrate with invalid parameters: %1",_this];
|
|
|
|
};
|
|
|
|
|
|
|
|
_crate = createVehicle [_crateClassName,_pos,[], 0, "CAN_COLLIDE"];
|
|
|
|
|
2015-09-12 01:21:53 +00:00
|
|
|
_crate allowDamage false;
|
|
|
|
|
2015-08-31 06:08:30 +00:00
|
|
|
clearWeaponCargoGlobal _crate;
|
|
|
|
clearItemCargoGlobal _crate;
|
|
|
|
clearMagazineCargoGlobal _crate;
|
|
|
|
clearBackpackCargoGlobal _crate;
|
|
|
|
|
2015-09-18 23:26:36 +00:00
|
|
|
if (DMS_HideBox) then
|
|
|
|
{
|
|
|
|
_crate hideObjectGlobal true;
|
|
|
|
};
|
|
|
|
|
2015-08-31 06:08:30 +00:00
|
|
|
_crate;
|