summaryrefslogtreecommitdiffstats
path: root/Client/Module/UAV/uav_spotter.sqf
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-11 19:38:09 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-11 19:38:09 +0300
commita3a91d4f45b22fd487ecbc954ad979be5d03efdd (patch)
treea554ab159a347dcd6c00ca1c7c26c1ec3ac0a6bd /Client/Module/UAV/uav_spotter.sqf
downloada2wf_chernarus-a3a91d4f45b22fd487ecbc954ad979be5d03efdd.tar.gz
a2wf_chernarus-a3a91d4f45b22fd487ecbc954ad979be5d03efdd.tar.bz2
a2wf_chernarus-a3a91d4f45b22fd487ecbc954ad979be5d03efdd.zip
Diffstat (limited to '')
-rw-r--r--Client/Module/UAV/uav_spotter.sqf28
1 files changed, 28 insertions, 0 deletions
diff --git a/Client/Module/UAV/uav_spotter.sqf b/Client/Module/UAV/uav_spotter.sqf
new file mode 100644
index 0000000..b1b0b17
--- /dev/null
+++ b/Client/Module/UAV/uav_spotter.sqf
@@ -0,0 +1,28 @@
+/*
+ Author: Benny
+ Name: uav_spotter.sqf
+ Parameters:
+ 0 - UAV
+ Description:
+ This file handle the UAV 'spotting' ability. If the UAV knows about an hostile unit, it'll reveal it's average location on the map.
+*/
+
+Private ['_delay','_range','_sensitivity','_uav'];
+_uav = _this select 0;
+_delay = 'WFBE_UAVSPOTTINGDELAY' Call GetNamespace;
+_range = 'WFBE_UAVSPOTTINGRANGE' Call GetNamespace;
+_sensitivity = 'WFBE_UAVSPOTTINGDETECTION' Call GetNamespace;
+
+while {true} do {
+ sleep _delay;
+ if (!alive _uav || isNull _uav) exitWith {};
+
+ {
+ if (_uav knowsAbout _x > _sensitivity && side _x != sideJoined && side _x != civilian) then {
+ sleep (0.05 + random 0.05);
+ WFBE_UAV_Reveal = [sideJoined,'CLTFNCUAV_REVEAL',[_uav,_x]];
+ publicVariable 'WFBE_UAV_Reveal';
+ if (isHostedServer) then {[sideJoined,'CLTFNCUAV_REVEAL',[_uav,_x]] Spawn HandlePVF};
+ };
+ } forEach (_uav nearEntities _range);
+};