summaryrefslogtreecommitdiffstats
path: root/Common/Functions/Common_GetTeamArtillery.sqf
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-11 19:55:41 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-11 19:55:41 +0300
commitdee52083d359434fc3ac51a871c1b836d092d2ac (patch)
tree89bbb6326348a99bcf4a68761bd0c9628b80d4bb /Common/Functions/Common_GetTeamArtillery.sqf
downloada2wf_lingor-dee52083d359434fc3ac51a871c1b836d092d2ac.tar.gz
a2wf_lingor-dee52083d359434fc3ac51a871c1b836d092d2ac.tar.bz2
a2wf_lingor-dee52083d359434fc3ac51a871c1b836d092d2ac.zip
init
Diffstat (limited to '')
-rw-r--r--Common/Functions/Common_GetTeamArtillery.sqf32
1 files changed, 32 insertions, 0 deletions
diff --git a/Common/Functions/Common_GetTeamArtillery.sqf b/Common/Functions/Common_GetTeamArtillery.sqf
new file mode 100644
index 0000000..3bc97d7
--- /dev/null
+++ b/Common/Functions/Common_GetTeamArtillery.sqf
@@ -0,0 +1,32 @@
+Private["_artillery","_artyTypes","_artyWeapons","_count","_ignoreAmmo","_index","_position","_search","_side","_team","_units","_vehicle","_weapon","_x","_y"];
+
+_team = _this select 0;
+_ignoreAmmo = _this select 1;
+_index = _this select 2;
+_side = _this select 3;
+
+if (_index < 0) exitWith {[]};
+
+_units = units _team;
+_artyTypes = (Format ["WFBE_%1_ARTILLERY_NAMES",_side] Call GetNamespace) select _index;
+_artyWeapons = Format ["WFBE_%1_ARTILLERY_WEAPONS",_side] Call GetNamespace;
+
+_artillery = [];
+
+{
+ _vehicle = vehicle _x;
+
+ if (typeOf(_vehicle) in _artyTypes) then {
+ if (!(isNull(gunner _vehicle)) && !(_vehicle in _artillery) && !(isPlayer(gunner _vehicle))) then {
+ if !(isPlayer(gunner _vehicle)) then {
+ _weapon = _artyWeapons select _index;
+
+ if (_ignoreAmmo || (_vehicle ammo _weapon > 0)) then {
+ _artillery = _artillery + [_vehicle];
+ };
+ };
+ };
+ };
+} forEach _units;
+
+_artillery \ No newline at end of file