deploy_stretcher.sqf 946 B

1234567891011121314151617181920212223242526272829
  1. #include "../../config_macros.hpp"
  2. params [
  3. ["_unit",player,[player]],
  4. ["_stretcher_object",macro_single_quote(macro_new_vehicle(Stretcher,MkII)),['string']],
  5. ["_stretcher_item",macro_single_quote(macro_new_weapon(Stretcher,Item)),['string']]
  6. ];
  7. hint format ["%1 %2 %3",_unit,_stretcher_item,_stretcher_object];
  8. _has_stretcher = [player,_stretcher_item] call ace_common_fnc_hasItem;
  9. if( !_has_stretcher) exitWith {hint 'f';};
  10. _pos = getPosATL _unit;
  11. _azimuth = getDir _unit;
  12. _far = 5; //Distance from the player to the _stretcher_object
  13. _x = (_pos select 0) + (_far * (sin _azimuth));
  14. _y = (_pos select 1) + (_far * (cos _azimuth));
  15. _pos_above = [_pos select 0,_pos select 1, (_pos select 2 )+ 1];
  16. _obj = createVehicle [_stretcher_object, _pos_above, [], _far, 'NONE'];//
  17. if(isNull _obj) exitWith {hint "Failed to deploy";};
  18. _unit removeItem _stretcher_item;
  19. hint "Stretcher Placed";
  20. //[_unit, _obj] call ace_dragging_fnc_startCarry;