# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kaarlos.gitbook.io/arma3-documentation/snippets-and-scripts/uav-terminal-on-object.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
