summaryrefslogtreecommitdiffstats
path: root/Common/Functions/Common_SpawnTurrets.sqf
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-11 19:55:04 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-11 19:55:04 +0300
commitb06990293397d4b6d0374097f09d1cc5679216e3 (patch)
tree5719922562e317a8083250c178f24376b6692569 /Common/Functions/Common_SpawnTurrets.sqf
downloada2wf_saralite-b06990293397d4b6d0374097f09d1cc5679216e3.tar.gz
a2wf_saralite-b06990293397d4b6d0374097f09d1cc5679216e3.tar.bz2
a2wf_saralite-b06990293397d4b6d0374097f09d1cc5679216e3.zip
init
Diffstat (limited to 'Common/Functions/Common_SpawnTurrets.sqf')
-rw-r--r--Common/Functions/Common_SpawnTurrets.sqf22
1 files changed, 22 insertions, 0 deletions
diff --git a/Common/Functions/Common_SpawnTurrets.sqf b/Common/Functions/Common_SpawnTurrets.sqf
new file mode 100644
index 0000000..b9ae10e
--- /dev/null
+++ b/Common/Functions/Common_SpawnTurrets.sqf
@@ -0,0 +1,22 @@
+private ["_turrets", "_path", "_vehicle", "_crew", "_team", "_unit"];
+_turrets = _this select 0;
+_path = _this select 1;
+_vehicle = _this select 2;
+_crew = _this select 3;
+_team = _this select 4;
+private ["_i"];
+_i = 0;
+while {_i < (count _turrets)} do {
+ private ["_turretIndex", "_thisTurret"];
+ _turretIndex = _turrets select _i;
+ _thisTurret = _path + [_turretIndex];
+
+ if (isNull (_vehicle turretUnit _thisTurret)) then {
+ _unit = [_crew,_team,getPos _vehicle,side _team] Call CreateMan;
+ _unit moveInTurret [_vehicle, _thisTurret];
+ };
+
+ //Spawn units into subturrets.
+ [_turrets select (_i + 1), _thisTurret, _vehicle, _crew, _team] call SpawnTurrets;
+ _i = _i + 2;
+}; \ No newline at end of file