From e4408384e02932fba689c157610bc5882ecd6876 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Mon, 2 Sep 2013 23:02:42 +0100 Subject: [PATCH] Create local_lights_off.sqf Add requirement for a running generator and remove lights if generator is switched off. --- SQF/dayz_code/compile/local_lights_off.sqf | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 SQF/dayz_code/compile/local_lights_off.sqf diff --git a/SQF/dayz_code/compile/local_lights_off.sqf b/SQF/dayz_code/compile/local_lights_off.sqf new file mode 100644 index 000000000..fb49a4609 --- /dev/null +++ b/SQF/dayz_code/compile/local_lights_off.sqf @@ -0,0 +1,20 @@ +/* + DayZ Epoch Lighting System + Made for DayZ Epoch please ask permission to use/edit/distrubute email axeman@thefreezer.co.uk. +*/ +private ["_objLightPoint","_rng","_nrstGen","_objHouse"]; +_rng = _this select 0; +_rng=_rng+5; +_nrstGen = _this select 1; +_objLightPoint = nearestObject [_nrstGen, "#lightpoint"]; + +while {_nrstGen distance _objLightPoint < _rng} do { +_objLightPoint = nearestObject [_nrstGen, "#lightpoint"]; +deleteVehicle _objLightPoint; +}; + +_objHouse = nearestObjects [_nrstGen, ["House"], _rng]; +{ +_x animate ["Lights_1",0]; +_x animate ["Lights_2",0]; +}forEach _objHouse;