From 628d33984d9228f1781d13a65fbb80f35facc899 Mon Sep 17 00:00:00 2001 From: hybrid Date: Thu, 11 Jun 2026 19:55:24 +0300 Subject: init --- Server/Functions/Server_SetCampsToSide.sqf | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Server/Functions/Server_SetCampsToSide.sqf (limited to 'Server/Functions/Server_SetCampsToSide.sqf') diff --git a/Server/Functions/Server_SetCampsToSide.sqf b/Server/Functions/Server_SetCampsToSide.sqf new file mode 100644 index 0000000..36df4d6 --- /dev/null +++ b/Server/Functions/Server_SetCampsToSide.sqf @@ -0,0 +1,30 @@ +Private["_camp","_camps","_count","_notifyAllSides","_objects","_previousSide","_side","_sideID","_startingSV","_texture","_town"]; + +_town = _this Select 0; +_side = _this Select 1; +_previousSide = _this Select 2; + +_sideID = _side Call GetSideID; +_camps = _town getVariable "camps"; +_startingSV = _town getVariable "supplyValue"; + +for [{_count = Count _camps - 1},{_count >= 0},{_count = _count - 1}] do { + _camp = _camps Select _count; + _camp setVariable ["sideID",_sideID,true]; + _camp setVariable ["supplyValue",_startingSV,true]; + + _texture = Format["WFBE_%1FLAG",str _side] Call GetNamespace; + + _objects = _camp nearEntities[[WFFLAG],20]; + if (count _objects > 0) then {(_objects Select 0) setFlagTexture _texture}; +}; + +sleep 0.5; + +_notifyAllSides = (_previousSide == East || _previousSide == West); + +WFBE_AllCampsCaptured = [nil,'CLTFNCALLCAMPSCAPTURED',[_town,_sideID,_notifyAllSides]]; +publicVariable 'WFBE_AllCampsCaptured'; +if (isHostedServer) then {[nil,'CLTFNCALLCAMPSCAPTURED',[_town,_sideID,_notifyAllSides]] Spawn HandlePVF}; + +diag_log Format["[WFBE (INFORMATION)][frameno:%3 | ticktime:%4] Server_SetCampsToSide: '%1' Camps have been set to %2",_town,str _side,diag_frameno,diag_tickTime]; -- cgit v1.3.1