From 68d4c9bbd80ed2e6528244569c79676b87295bd1 Mon Sep 17 00:00:00 2001 From: hybrid Date: Thu, 11 Jun 2026 19:54:45 +0300 Subject: init --- Common/Functions/Common_GetHostilesInArea.sqf | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Common/Functions/Common_GetHostilesInArea.sqf (limited to 'Common/Functions/Common_GetHostilesInArea.sqf') diff --git a/Common/Functions/Common_GetHostilesInArea.sqf b/Common/Functions/Common_GetHostilesInArea.sqf new file mode 100644 index 0000000..eef2647 --- /dev/null +++ b/Common/Functions/Common_GetHostilesInArea.sqf @@ -0,0 +1,18 @@ +Private ['_hostiles','_object','_objects','_safeFromSide','_within']; +_object = _this select 0; +_safeFromSide = _this select 1; +_within = if (count _this > 2) then {_this select 2} else {50}; + +_objects = _object nearEntities[[eastSoldierBaseClass,westSoldierBaseClass,resistanceSoldierBaseClass,"Car","Motorcycle","Tank","Air"],_within]; +_hostiles = 0; + +if (typeName _safeFromSide == 'ARRAY') then { + { + _hostiles = _hostiles + (_x countSide _objects); + } forEach _safeFromSide; +}; +if (typeName _safeFromSide == 'SIDE') then { + _hostiles = _hostiles + (_safeFromSide countSide _objects); +}; + +_hostiles \ No newline at end of file -- cgit v1.3.1