# UAV Terminal On Object

Place down a object, in the init field of the object put this code

{% code overflow="wrap" %}
```sqf
this addAction 
[ 
 "Open UAV Terminal", 
 { 
  params ["_target", "_caller", "_actionId", "_arguments"]; 
 
  _caller linkItem "B_UavTerminal"; 
  waitUntil{ "B_UavTerminal" in assignedItems _caller}; 
 
  _caller action ["UAVTerminalOpen", _caller]; 
  waitUntil {!isNull findDisplay 160}; 
 
  if !(isNil "uav_PVC_EH") then{ 
   removeMissionEventHandler ["PlayerViewChanged", uav_PVC_EH]; 
  }; 
 
  uav_PVC_EH = addMissionEventHandler ["PlayerViewChanged", 
  { 
   params ["_oldUnit", "_newUnit", "_vehicleIn", "_oldCameraOn", "_newCameraOn", "_uav"]; 
 
   [] spawn{ 
    findDisplay 160 displayAddEventHandler ["KeyDown", " 
     params ['_ctrl', '_dikCode', '_shift', '_ctrlKey', '_alt']; 
 
     if (_dikCode in (actionKeys 'hideMap') || _dikCode in (actionKeys 'ingamePause')) then{ 
      player connectTerminalToUAV objNull; 
      player unlinkItem 'B_UavTerminal'; 
 
      removeMissionEventHandler ['PlayerViewChanged', uav_PVC_EH]; 
     }; 
    "]; 
   }; 
  }]; 
 
  findDisplay 160 displayAddEventHandler ["KeyDown", " 
   params ['_ctrl', '_dikCode', '_shift', '_ctrlKey', '_alt']; 
 
   if (_dikCode in (actionKeys 'hideMap') || _dikCode in (actionKeys 'ingamePause')) then{ 
    player connectTerminalToUAV objNull; 
    player unlinkItem 'B_UavTerminal'; 
 
    if !(isNil 'uav_PVC_EH') then{ 
     removeMissionEventHandler ['PlayerViewChanged', uav_PVC_EH]; 
    }; 
   }; 
  "]; 
 
 }, 
 nil, 
 1.5, 
 true, 
 true, 
 "", 
 "isPlayer _this", 
 3, 
 false, 
 "", 
 "" 
];
```
{% endcode %}
