mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-06-10 11:53:21 +03:00
Update server spawn_vehicles
Updated loot spawning code for vehicle cargo. Also it is faster and more efficient to call spawn_vehicles repeatedly in one thread rather than spawn it hundreds of times (opening hundreds of simultaneous script threads).
This commit is contained in:
@@ -1,19 +1,15 @@
|
||||
private ["_position","_veh","_istoomany","_spawnveh"];
|
||||
// do not make _roadList or _buildingList private in this function
|
||||
|
||||
waitUntil {!isNil "BIS_fnc_selectRandom"};
|
||||
_position = roadList call BIS_fnc_selectRandom;
|
||||
_position = _roadList call BIS_fnc_selectRandom;
|
||||
_position = _position modelToWorld [0,0,0];
|
||||
|
||||
waitUntil {!isNil "BIS_fnc_findSafePos"};
|
||||
_position = [_position,0,10,5,0,2000,0] call BIS_fnc_findSafePos;
|
||||
|
||||
if ((count _position) == 2) then {
|
||||
_istoomany = _position nearObjects ["All",5];
|
||||
if ((count _istoomany) > 0) exitWith {};
|
||||
|
||||
waitUntil {!isNil "BIS_fnc_selectRandom"};
|
||||
_spawnveh = DZE_isWreck call BIS_fnc_selectRandom;
|
||||
|
||||
_veh = createVehicle [_spawnveh,_position, [], 0, "CAN_COLLIDE"];
|
||||
_veh enableSimulation false;
|
||||
_veh setDir round(random 360);
|
||||
|
||||
Reference in New Issue
Block a user