It is currently Mon Dec 11, 2017 7:38 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Mar 21, 2017 9:52 am 
Offline
User avatar

Joined: Thu Aug 18, 2016 10:10 am
Posts: 16
As you can see from the code below there are several markers that define an area. This code was used to kill all lights in a city but can be modified to your specific needs. Each marker has a 500 meter radius to which it will find the lights and destroy. You could also change the type of lamps depending on specific maps. I will follow up later with a list of these

Code:

// off: 0 = [0.95] execVM "lights.sqf";
// on: 0 = [0] execVM "lights.sqf";

_types = ["Lamps_Base_F", "PowerLines_base_F","Land_PowerPoleWooden_L_F"];
_onoff = _this select 0;

for [{_i=0},{_i < (count _types)},{_i=_i+1}] do
{
   // powercoverage is a marker I placed.
_lamps = getMarkerPos "powercoverage" nearObjects [_types select _i, 500];
_lamps1 = getMarkerPos "powercoverage1" nearObjects [_types select _i, 500];
_lamps2 = getMarkerPos "powercoverage2" nearObjects [_types select _i, 500];
_lamps3 = getMarkerPos "powercoverage3" nearObjects [_types select _i, 500];
_lamps4 = getMarkerPos "powercoverage4" nearObjects [_types select _i, 500];
_lamps5 = getMarkerPos "powercoverage5" nearObjects [_types select _i, 500];

{_x setDamage _onoff} forEach _lamps5;
sleep 1;
{_x setDamage _onoff} forEach _lamps;
sleep 0.5;
{_x setDamage _onoff} forEach _lamps1;
sleep 0.5;
{_x setDamage _onoff} forEach _lamps2;
sleep 0.5;
{_x setDamage _onoff} forEach _lamps3;
sleep 0.5;
{_x setDamage _onoff} forEach _lamps4;
};




Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group