Files
DayZ-Epoch/SQF/dayz_code/system/building_monitor.sqf
icomrade e54b9983dd Replace forEach with Count
Use count where you do not need _forEachIndex variable, it's quicker
than forEach.
2014-05-27 15:37:57 -04:00

18 lines
505 B
Plaintext

private ["_building","_GroupMarker","_nearby","_run","_items"];
_building = _this select 0;
_GroupMarker = _this select 1;
_items = _this select 2;
_run = true;
_nearby = false;
while {_run} do {
if (isNull _building) then {_run = false};
_nearby = false;
{
if (_x distance _building < 500) then {_nearby = true};
} count (call BIS_fnc_listPlayers);
if (!_nearby) then {_run = false};
sleep 5;
};
{deleteVehicle _x;} count _items;
_building setVariable ["looted",(DateToNumber date),true];