diff options
| author | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:54:45 +0300 |
|---|---|---|
| committer | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:54:45 +0300 |
| commit | 68d4c9bbd80ed2e6528244569c79676b87295bd1 (patch) | |
| tree | 6efd42fbf6f1281874ae0ff1f8816b01fe0c7153 /Server/Functions/Server_SetCampsToSide.sqf | |
| download | a2wf_takistan-68d4c9bbd80ed2e6528244569c79676b87295bd1.tar.gz a2wf_takistan-68d4c9bbd80ed2e6528244569c79676b87295bd1.tar.bz2 a2wf_takistan-68d4c9bbd80ed2e6528244569c79676b87295bd1.zip | |
init
Diffstat (limited to 'Server/Functions/Server_SetCampsToSide.sqf')
| -rw-r--r-- | Server/Functions/Server_SetCampsToSide.sqf | 30 |
1 files changed, 30 insertions, 0 deletions
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];
|
