summaryrefslogtreecommitdiffstats
path: root/Server/AI/AI_TLWPHandler.sqs
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-11 19:57:23 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-11 19:57:23 +0300
commit3533c3aa9393fc6350178b196c813dc636ec9cf6 (patch)
tree2f96a879c3935dea18e73410926b03c7eef1a751 /Server/AI/AI_TLWPHandler.sqs
downloada2wf_isladuala-3533c3aa9393fc6350178b196c813dc636ec9cf6.tar.gz
a2wf_isladuala-3533c3aa9393fc6350178b196c813dc636ec9cf6.tar.bz2
a2wf_isladuala-3533c3aa9393fc6350178b196c813dc636ec9cf6.zip
init
Diffstat (limited to 'Server/AI/AI_TLWPHandler.sqs')
-rw-r--r--Server/AI/AI_TLWPHandler.sqs39
1 files changed, 39 insertions, 0 deletions
diff --git a/Server/AI/AI_TLWPHandler.sqs b/Server/AI/AI_TLWPHandler.sqs
new file mode 100644
index 0000000..c94a6a8
--- /dev/null
+++ b/Server/AI/AI_TLWPHandler.sqs
@@ -0,0 +1,39 @@
+Private ["_group","_i","_timeSince","_unit","_units","_waitForMembers","_wpPos"]
+_group = _this select 0
+_wpPos = _this select 1
+
+_timeSince = 0
+
+if (vehicle (leader _group) isKindOf "Air") then {Goto "Exit";}
+
+#Main
+ ~5
+
+ _timeSince = _timeSince + 5
+
+ ;Check for the group's status.
+ _units = ((units _group) Call GetLiveUnits) - [leader _group]
+
+ ;Exit if the leader is the only member.
+ if (count _units < 2) then {Goto "Exit";}
+
+ _i = 0
+ _waitForMembers = false
+
+ ;Iterate through all members.
+ #Loop
+ _unit = _units select _i
+
+ if (_unit distance (leader _group) > 150 && !(_unit isKindOf 'Air')) then {_waitForMembers = true; if (_timeSince > 240) then {[vehicle _unit,getPos (leader _group),75] Call PlaceSafe;};}
+
+ _i = _i + 1
+
+ if (_i == count _units) then {if (_waitForMembers) then {Goto "Main";} else {Goto "Exit";}};
+
+ Goto "Loop"
+
+ Goto "Main"
+
+#Exit
+
+ Exit \ No newline at end of file