diff options
| author | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:53:22 +0300 |
|---|---|---|
| committer | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:53:22 +0300 |
| commit | c055d44dcdb87e8db49fb23e632fc086aa44cce6 (patch) | |
| tree | 7ac98d865915930bebc86b36b512a859c31538e5 /Client/Module/UAV/uav_spotter.sqf | |
| download | a2wf_zargabad-c055d44dcdb87e8db49fb23e632fc086aa44cce6.tar.gz a2wf_zargabad-c055d44dcdb87e8db49fb23e632fc086aa44cce6.tar.bz2 a2wf_zargabad-c055d44dcdb87e8db49fb23e632fc086aa44cce6.zip | |
init
Diffstat (limited to '')
| -rw-r--r-- | Client/Module/UAV/uav_spotter.sqf | 28 |
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);
+};
|
