ACE3/addons/laserpointer/functions/fnc_getNearUnits.sqf
Phyma ffaa195fe5 Conform function headers to coding guidelines (#5255)
* Fixed headers to work with silentspike python script

* Fixed rest of the files

* Fixed ace-team
2017-06-08 15:31:51 +02:00

30 lines
518 B
Plaintext

/*
* Author: commy2
* Reports near units.
*
* Arguments:
* None
*
* Return Value:
* Near Units <ARRAY>
*
* Example:
* call ACE_laserpointer_fnc_getNearUnits
*
* Public: No
*/
#include "script_component.hpp"
private _camPosAGL = positionCameraToWorld [0, 0, 0];
// handle RHS / bugged vehicle slots
if !((_camPosAGL select 0) isEqualType 0) exitWith { [] };
private _nearUnits = [];
{
_nearUnits append crew _x;
} forEach nearestObjects [_camPosAGL, ["AllVehicles"], MAX_LASER_RANGE];
_nearUnits