Advertisement
Guest User

Untitled

a guest
Jan 15th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 2.23 KB | None | 0 0
  1. /*
  2. *
  3. *    File: fn_ejectVehicle.sqf
  4. *    =========================
  5. *    Author: [DA3F] Aroun Le BriCodeur.
  6. *    ==================================
  7. *    Description: * * * *
  8. *
  9. *    Eject vehicle
  10. *    player addEventHandler ["GetInMan",{_this spawn DA3F_fnc_ejectVehicle;}];
  11. *
  12. */
  13.  
  14.         params ["_unit", "_role", "_vehicle", "_turret"];
  15.         private _RecSpeed   = 0;
  16.         private _DA3F_vel   = 0;
  17.         private _DA3F_dir   = 0;
  18.         private _DA3F_speed = 0;
  19.             while {driver _vehicle isEqualTo _unit} do {
  20.                 waitUntil {speed _vehicle > 5};
  21.                 _RecSpeed = speed _vehicle;
  22.                 sleep 0.1;
  23.                 if (_RecSpeed >= 50 && speed _vehicle <= 5) then {
  24.                     if ((random 100) < 100) then {
  25.                     _DA3F_vel   = velocity _vehicle;
  26.                     _DA3F_dir   = direction _vehicle;
  27.                     _DA3F_speed = (8 + random 3);
  28.                     player setpos (_vehicle modelToWorld [0.5,0.3,0]);
  29.                     player switchAction "";
  30.                     player playMoveNow "halofreefall_non"; // comment "or amovppnemstpsnonwnondnon";
  31.                         sleep 0.1;
  32.                                 player setVelocity [
  33.                             (_DA3F_vel select 0) + (sin _DA3F_dir * _DA3F_speed),
  34.                             (_DA3F_vel select 1) + (cos _DA3F_dir * _DA3F_speed),
  35.                             (_DA3F_vel select 2)
  36.                         ];
  37.                         waitUntil { (getPosATL player)param[2] <= 0.1};
  38.                         player switchMove selectRandom["unconsciousfacedown","unconsciousrevivedefault","UnconsciousReviveBody_A","UnconsciousReviveArms_A","UnconsciousReviveArms_B","UnconsciousReviveArms_C","UnconsciousReviveHead_A","UnconsciousReviveHead_B","UnconsciousReviveHead_C","UnconsciousReviveLegs_A","UnconsciousReviveLegs_B"];
  39.                         hint "La vitesse fait des centaines de morts sur les routes.";
  40.                         sleep (10 + random 10);
  41.                         if !((lifeState player) in ["INCAPACITATED"]) then {
  42.                            player switchMove "UnconsciousOutProne";
  43.                         };
  44.                     };
  45.                 };
  46.             };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement