Advertisement
Thatguy5532

Halo Jump

Jun 23rd, 2023
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. params["_player", "_position"];
  2.  
  3. private _jumpDelay = 3; // Seconds
  4. deleteMarkerLocal "halo_marker";
  5. if (_position isEqualTo [0,0,0]) exitWith {
  6. systemChat "No Jump coords marked...";
  7. };
  8.  
  9. ["HaloJumping", [format["Halo Jumping! Please wait %1 seconds...", _jumpDelay]]] call BIS_fnc_showNotification;
  10. sleep _jumpDelay;
  11.  
  12. private _squadBool = uiNamespace getVariable["TRA_haloSquadBool", false];
  13. private _vehicleBool = uiNamespace getVariable["TRA_haloVehicleBool", false];
  14. private _vehicle = uiNamespace getVariable["TRA_haloVehicle", objNull];
  15. private _players = [];
  16. // Bring the halo jump initiator as well
  17. _players pushBack _player;
  18.  
  19. // Infantry Check
  20. if (_squadBool isEqualTo 1) then {
  21. {
  22. // Current result is saved in variable _x
  23. _players pushBack _x;
  24. } forEach ((_player nearEntities ["CAManBase", 15]) select { groupId _x isEqualTo groupId _player});
  25. };
  26.  
  27. playSound ['FlyBy', false, 0];
  28. // Vehicle Check
  29. if (_vehicleBool isEqualTo 1) exitWith {
  30. _veh = _vehicle;
  31.  
  32. if (_veh isEqualTo objNull || _veh isEqualTo "") exitWith {
  33. systemChat "No Vehicle Selected...";
  34. };
  35.  
  36. _veh setPosATL _position;
  37. _veh addBackpackCargoGlobal ["B_Parachute", count (crew _veh select {isPlayer _x})];
  38.  
  39. _chute = createVehicle ["B_Parachute_02_F", [0, 0, 1000], [], 0, "NONE"];
  40. _chute allowDamage false;
  41. _chute enableSimulation false;
  42.  
  43. // Make chute wait until certain altitude to deploy (not very smooth, insta stops vehicle mid air)
  44. [_veh, _chute] spawn {
  45. params["_veh", "_chute"];
  46. while {((getPosATL _veh) select 2) >= 350} do {
  47. sleep 1;
  48. };
  49. _vehPos = getPosATL _veh;
  50. _chute setPosATL _vehPos;
  51. _chute allowDamage true;
  52. _chute enableSimulation true;
  53. _veh attachTo [_chute, [0, 0, 2]];
  54. };
  55.  
  56. {
  57. // Current result is saved in variable _x
  58. _space = random 15;
  59. _x setPosATL [(_position select 0) + _space, (_position select 1) + _space, _position select 2];
  60. _x setVariable ['TRA_lastHalo', diag_tickTime];
  61. if ((backpack _x) isNotEqualTo "") then {
  62. [_x] call bocr_main_fnc_actionOnChest;
  63. };
  64. _x addBackpack "B_Parachute";
  65. } forEach _players;
  66. };
  67.  
  68. {
  69. // Current result is saved in variable _x
  70. _space = random 15;
  71. _x setPosATL [(_position select 0) + _space, (_position select 1) + _space, _position select 2];
  72. _x setVariable ['TRA_lastHalo', diag_tickTime];
  73. [_x] call bocr_main_fnc_actionOnChest;
  74. _x addBackpack "B_Parachute";
  75. } forEach _players;
  76.  
  77. _player setVariable ['TRA_lastHalo', diag_tickTime];
  78. [_player] call bocr_main_fnc_actionOnChest;
  79. _player addBackpack "B_Parachute";
  80.  
  81. _player setPosATL _position;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement