mirror of
https://github.com/Defent/DMS_Exile.git
synced 2024-08-30 16:52:12 +00:00
Merge pull request #8 from DevZupa/F-DMS-001-SpawnNonPersistentVehicle
Spawns a non persistence vehicle in the closest open spot. Thanks Zupa!
This commit is contained in:
commit
7051308156
@ -34,6 +34,7 @@ DMS_CreateMarker = compileFinal preprocessFileLineNumbers "\x\addons\dms\sc
|
|||||||
DMS_FindSuppressor = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\FindSuppressor.sqf";
|
DMS_FindSuppressor = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\FindSuppressor.sqf";
|
||||||
DMS_SpawnCrate = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\SpawnCrate.sqf";
|
DMS_SpawnCrate = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\SpawnCrate.sqf";
|
||||||
DMS_SetAILocality = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\SetAILocality.sqf";
|
DMS_SetAILocality = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\SetAILocality.sqf";
|
||||||
|
DMS_SpawnNonPersistentVehicle = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\SpawnNonPersistentVehicle.sqf";
|
||||||
|
|
||||||
//Load config
|
//Load config
|
||||||
call compileFinal preprocessFileLineNumbers "\x\addons\dms\config.sqf";
|
call compileFinal preprocessFileLineNumbers "\x\addons\dms\config.sqf";
|
@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
Spawn a non-saved vehicle in Exile
|
||||||
|
|
||||||
|
_exampleVeh = ['Exile_Chopper_Hummingbird_Green',_pos] call DMS_SpawnNonPersistentVehicle;
|
||||||
|
|
||||||
|
Created by Zupa
|
||||||
|
*/
|
||||||
|
|
||||||
|
private ["_vehicleClass","_position","_vehpos","_maxDistance","_vehObj"];
|
||||||
|
|
||||||
|
_vehicleClass = _this select 0;
|
||||||
|
_position = _this select 1;
|
||||||
|
_vehpos = [];
|
||||||
|
_maxDistance = 40;
|
||||||
|
|
||||||
|
while{count _vehpos < 1} do {
|
||||||
|
_vehpos = _position findEmptyPosition[20,_maxDistance,_vehicleClass];
|
||||||
|
_maxDistance = (_maxDistance + 15);
|
||||||
|
};
|
||||||
|
|
||||||
|
_vehObj = ObjNull;
|
||||||
|
_vehObj = [_vehicleClass, _vehpos, (random 360), true] call ExileServer_object_vehicle_createNonPersistentVehicle;
|
||||||
|
_vehObj
|
Loading…
Reference in New Issue
Block a user