fn_lockUavCamTo.sqf 785 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. Name: cTab_fnc_lockUavCamTo
  3. Author(s):
  4. Gundy
  5. Description:
  6. Lock the currently selected UAV's gunner camera to the provided coordinates
  7. Parameters:
  8. 0: ARRAY - 2D or 3D position
  9. Returns:
  10. BOOLEAN - If UAV was found
  11. Example:
  12. [getPos player] call cTab_fnc_lockUavCamTo;
  13. */
  14. private ["_displayName","_uav","_data","_camPos"];
  15. _displayName = cTabIfOpen select 1;
  16. _uav = objNull;
  17. _data = [_displayName,"uavCam"] call cTab_fnc_getSettings;
  18. // see if given UAV name is still in the list of valid UAVs
  19. {
  20. if (_data == str _x) exitWith {_uav = _x;};
  21. } count cTabUAVlist;
  22. if !(isNull _uav) exitWith {
  23. _camPos = _this select 0;
  24. if (count _camPos == 2) then {
  25. _camPos = _camPos + [getTerrainHeightASL _camPos];
  26. };
  27. _uav lockCameraTo [_camPos,[0]];
  28. true
  29. };
  30. false