From c055d44dcdb87e8db49fb23e632fc086aa44cce6 Mon Sep 17 00:00:00 2001 From: hybrid Date: Thu, 11 Jun 2026 19:53:22 +0300 Subject: init --- Common/Functions/Common_GetTotalCampsOnSide.sqf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Common/Functions/Common_GetTotalCampsOnSide.sqf (limited to 'Common/Functions/Common_GetTotalCampsOnSide.sqf') diff --git a/Common/Functions/Common_GetTotalCampsOnSide.sqf b/Common/Functions/Common_GetTotalCampsOnSide.sqf new file mode 100644 index 0000000..10619dc --- /dev/null +++ b/Common/Functions/Common_GetTotalCampsOnSide.sqf @@ -0,0 +1,15 @@ +Private["_camps","_side","_sideID","_total","_town"]; + +_town = _this select 0; +_side = _this select 1; + +_sideID = _side Call GetSideID; + +_camps = _town getVariable "camps"; +if (isNil '_camps') exitWith {1}; +if (count _camps == 0) exitWith {1}; +_total = 0; + +{if ((_x getVariable "sideID") == _sideID) then {_total = _total + 1}} forEach _camps; + +_total \ No newline at end of file -- cgit v1.3.1