mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
e2ac18a05d
* advanced_ballistics * advanced_fatigue * advanced_throwing * ai * aircraft * arsenal * atragmx * attach * backpacks * ballistics * captives * cargo * chemlights * common * concertina_wire * cookoff * dagr * disarming * disposable * dogtags * dragging * explosives * fastroping * fcs * finger * frag * gestures * gforces * goggles * grenades * gunbag * hearing * hitreactions * huntir * interact_menu * interaction * inventory * kestrel4500 * laser * laserpointer * logistics_uavbattery * logistics_wirecutter * magazinerepack * map * map_gestures * maptools * markers * medical * medical_ai * medical_blood * medical_menu * microdagr * minedetector * missileguidance * missionmodules * mk6mortar * modules * movement * nametags * nightvision * nlaw * optics * optionsmenu * overheating * overpressure * parachute * pylons * quickmount * rangecard * rearm * recoil * refuel * reload * reloadlaunchers * repair * respawn * safemode * sandbag * scopes * slideshow * spectator * spottingscope * switchunits * tacticalladder * tagging * trenches * tripod * ui * vector * vehiclelock * vehicles * viewdistance * weaponselect * weather * winddeflection * yardage450 * zeus * arsenal defines.hpp * optionals * DEBUG_MODE_FULL 1 * DEBUG_MODE_FULL 2 * Manual fixes * Add SQF Validator check for #include after block comment * explosives fnc_openTimerUI * fix uniqueItems
43 lines
1.1 KiB
Plaintext
43 lines
1.1 KiB
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: Garth 'L-H' de Wet, commy2
|
|
* Checks for nearby running helicopters (within 15m)
|
|
*
|
|
* Arguments:
|
|
* 0: Unit <OBJECT>
|
|
* 1: Radius to check for helicopter (default: 15) <NUMBER>
|
|
*
|
|
* Return Value:
|
|
* Array <ARRAY>:
|
|
* 0: In rotorwash <BOOL>
|
|
* 1: Amount of rotor wash. <NUMBER>
|
|
*
|
|
* Example:
|
|
* if ([ace_player, 10] call ace_goggles_fnc_isInRotorWash select 0) then { hint "Rotor wash"; };
|
|
* if ([ace_player] call ace_goggles_fnc_isInRotorWash select 0) then { hint "Rotor wash"; };
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
|
|
params ["_unit", ["_radius", 15]];
|
|
|
|
private _rotorWash = [false, 0];
|
|
|
|
{
|
|
if (isEngineOn _x) then {
|
|
private _distance = _unit distance _x;
|
|
|
|
// convert distance to 0...1 range, where 0 is the maximum radius
|
|
_distance = 1 - _distance / _radius;
|
|
|
|
// use highest amount of rotor wash as return value in case of multiple helicopters
|
|
if (_distance > _rotorWash select 1) then {
|
|
_rotorWash set [0, true];
|
|
_rotorWash set [1, _distance];
|
|
};
|
|
};
|
|
false
|
|
} count (position _unit nearEntities [["Helicopter"], _radius]);
|
|
|
|
_rotorWash
|