arma2-epoch-server/@DayZ_Epoch_Server/addons/dayz_server/compile/spawn_ammosupply.sqf
stuzer05 61de8f76f3 #15 Upgrade to Epoch 1.7.0.1 (#16)
Closes #15

Reviewed-on: #16
Co-authored-by: stuzer05 <stuzer05@stuzer.link>
Co-committed-by: stuzer05 <stuzer05@stuzer.link>
2023-10-01 21:22:36 +03:00

23 lines
813 B
Plaintext
Executable File

/*
Spawns several random "Supply_Crate_DZE" across map.
Lootable by destroying and then opening with crowbar.
Currently outputs vehicle ammo defined in Land_ammo_supply_wreck CfgVehicles class
*/
private ["_position","_veh","_istoomany"];
// do not make _roadList or _buildingList private in this function
_position = _roadList call BIS_fnc_selectRandom;
_position = _position modelToWorld [0,0,0];
_position = [_position,5,20,5,0,2000,0] call BIS_fnc_findSafePos;
if ((count _position) == 2) then {
_istoomany = _position nearObjects ["All",5];
if ((count _istoomany) > 0) exitWith {};
//_veh = createVehicle ["Supply_Crate_DZE",_position, [], 0, "CAN_COLLIDE"];
_veh = "Supply_Crate_DZE" createVehicle [0,0,0];
_veh enableSimulation false;
_veh setDir round(random 360);
_veh setPos _position;
};