Advertisement
Thatguy5532

Untitled

Jun 24th, 2023
522
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 2.82 KB | None | 0 0
  1. span class="re5"> 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. systemChat str (typeOf _vehicle);
  16. private _players = [];
  17. // Bring the halo jump initiator as well
  18. _players pushBack _player;
  19.  
  20. // Infantry Check
  21. if (_squadBool isEqualTo 1) then {
  22.     _squad = (units (group _player)) select {
  23.         (_player distance2D _x) <= 15
  24.     };
  25.  
  26.     systemChat (str _squad);
  27.  
  28.     {
  29.         // Current result is saved in variable _x
  30.         _players pushBack _x;
  31.     } forEach (_squad);
  32. };
  33.  
  34. // Vehicle Check
  35. if (_vehicleBool isEqualTo 1) exitWith {
  36.     systemChat "_vehicleBool was 1";
  37.     // _veh = _vehicle;
  38.  
  39.     if (_vehicle isEqualTo objNull || _vehicle isEqualTo "") exitWith {
  40.         systemChat "No Vehicle Selected...";
  41.     };
  42.     playSound ['FlyBy', false, 0];
  43.  
  44.     _vehicle setPosATL _position;
  45.     _vehicle addBackpackCargoGlobal ["B_Parachute", count (crew _vehicle select {isPlayer _x})];
  46.  
  47.     _chute = createVehicle ["B_Parachute_02_F", [0, 0, 1000], [], 0, "NONE"];
  48.     _chute allowDamage false;
  49.     _chute enableSimulation false;
  50.  
  51.     // Make chute wait until certain altitude to deploy (not very smooth, insta stops vehicle mid air)
  52.     [_vehicle, _chute] spawn {
  53.         params["_veh", "_chute"];
  54.         while {((getPosATL _veh) select 2) >= 350} do {
  55.             sleep 1;
  56.         };
  57.         _vehPos = getPosATL _veh;
  58.         _chute setPosATL _vehPos;
  59.         _chute allowDamage true;
  60.         _chute enableSimulation true;
  61.         _veh attachTo [_chute, [0, 0, 2]];
  62.     };
  63.  
  64.     {
  65.         // Current result is saved in variable _x
  66.         _space = random 15;
  67.         _x setPosATL [(_position select 0) + _space, (_position select 1) + _space, _position select 2];
  68.         _x setVariable ['TRA_lastHalo', diag_tickTime];
  69.         if ((backpack _x) isNotEqualTo "") then {
  70.             [_x] call bocr_main_fnc_actionOnChest;
  71.         };
  72.         _x addBackpack "B_Parachute";
  73.     } forEach _players;
  74. };
  75.  
  76. systemChat "Vehicle Bool Was:";
  77. systemChat str _vehicleBool;
  78. playSound ['FlyBy', false, 0];
  79. {
  80.     // Current result is saved in variable _x
  81.     _space = random 15;
  82.     _x setPosATL [(_position select 0) + _space, (_position select 1) + _space, _position select 2];
  83.     _x setVariable ['TRA_lastHalo', diag_tickTime];
  84.     if ((backpack _x) isNotEqualTo "") then {
  85.             [_x] call bocr_main_fnc_actionOnChest;
  86.     };
  87.     _x addBackpack "B_Parachute";
  88. } forEach _players;
  89.  
  90. _player setVariable ['TRA_lastHalo', diag_tickTime];
  91. [_player] call bocr_main_fnc_actionOnChest;
  92. _player addBackpack "B_Parachute";
  93.  
  94. _player setPosATL _position;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement