2015-01-17 22:38:13 +00:00
// by commy2
#include "script_component.hpp"
2015-04-07 17:38:19 +00:00
// fixes laser when being captured. Needed, because the selectionpsoition of the right hand is used
["SetHandcuffed", {if (_this select 1) then {(_this select 0) action ["GunLightOff", _this select 0]};}] call EFUNC(common,addEventHandler);
2015-01-18 02:48:44 +00:00
if !(hasInterface) exitWith {};
2015-01-17 22:38:13 +00:00
GVAR(nearUnits) = [];
// @todo. Maybe move to common?
[{
private "_nearUnits";
2015-04-14 11:24:17 +00:00
_nearUnits = [];
2015-01-17 22:38:13 +00:00
2015-04-14 11:24:17 +00:00
{
_nearUnits append crew _x;
if (count _nearUnits > 10) exitWith {
_nearUnits resize 10;
};
} forEach nearestObjects [positionCameraToWorld [0,0,0], ["AllVehicles"], 50]; // when moving this, search also for units inside vehicles. currently breaks the laser in FFV
2015-01-17 22:38:13 +00:00
GVAR(nearUnits) = _nearUnits;
} , 5, []] call CBA_fnc_addPerFrameHandler;
addMissionEventHandler ["Draw3D", {
call FUNC(onDraw);
}];
2015-04-13 22:32:09 +00:00
2015-04-14 11:24:17 +00:00
#include "initKeybinds.sqf"