Advertisement
Muzze77

[Arma 3] Remove from Vehicle

Dec 16th, 2017
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 4.36 KB | None | 0 0
  1. _car = (_this select 0);
  2. _unit = (_this select 1);
  3.  
  4. _carName = typeof _car;
  5.  
  6.  
  7. FNC_MZ_GetOutCar = {
  8. _car = _this select 0;
  9. _carName = typeOf _car;
  10. _i = 0;
  11. _maxAttached = count attachedObjects _car;
  12. _n = 0;
  13. _f = 0;
  14. _b = -9;
  15. {
  16.     _n = _n + 1;
  17.     detach _x;
  18.     switch (_carName) do
  19.     {
  20.         case "B_UGV_01_F":
  21.         {
  22.             _b = -4;
  23.         };
  24.         case "B_Heli_Transport_03_unarmed_F":
  25.         {
  26.             _b = -9;
  27.         };
  28.         case "C_Van_02_vehicle_F":
  29.         {
  30.             _b = -6;
  31.         };
  32.         case "C_Van_02_transport_F":
  33.         {
  34.             _b = -6;
  35.         };
  36.         case "C_Offroad_01_F":
  37.         {
  38.             _b = -5;
  39.         };
  40.         case "O_MRAP_02_F":
  41.         {
  42.             _b = -8;
  43.         };
  44.     };
  45.    
  46.    
  47.     _x setPos (_car modelToWorld [0,_b +_f,0]);
  48.     _x setPos [getPos _x select 0,getPos _x select 1,0 + _i];
  49.     _x setDir (getDir _car) + 90;
  50.     _i = _i + 0.67;
  51.    
  52.     if (_n == 3) then
  53.     {
  54.         _f = _f - 1;
  55.         _n = 0;
  56.         _i = 0;
  57.        
  58.     };
  59.    
  60.    
  61.     removeallactions _x;
  62.     _x addAction ["Aufheben","carry_create.sqf"];
  63.  
  64.  
  65. } forEach attachedObjects _car;
  66.  
  67.  
  68. };
  69.  
  70. switch (_carName) do
  71. {
  72.     //Van Transport
  73.     case "C_Van_02_vehicle_F":
  74.     {
  75.         _doorState = _car doorPhase "door_4_source";
  76.         if (_doorState == 1) then
  77.         {
  78.             _handle = false;
  79.             _handle = [[_car],"FNC_MZ_GetOutCar",true,true] call BIS_fnc_MP;
  80.             removeallactions _unit;
  81.             removeallactions _car;
  82.             _car addAction ["In Fahrzeug ablegen","placeInObj.sqf",nil,1.5,false,false,"","true",5];
  83.             if (_doorState == 1) then
  84.             {
  85.             _car addAction ["Kofferraum schliessen","openTunk.sqf"];
  86.             }
  87.             else
  88.             {
  89.             _car addAction ["Kofferraum oeffnen","openTunk.sqf"];
  90.    
  91.             };
  92.    
  93.         }
  94.         else
  95.         {
  96.             hint "Fahrzeugtuer ist geschlossen";
  97.         };
  98.     };
  99.    
  100.     //Van Group
  101.     case "C_Van_02_transport_F":
  102.     {
  103.         _doorState = _car doorPhase "door_4_source";
  104.         if (_doorState == 1) then
  105.         {
  106.             _handle = false;
  107.             _handle = [[_car],"FNC_MZ_GetOutCar",true,true] call BIS_fnc_MP;
  108.             removeallactions _unit;
  109.             removeallactions _car;
  110.             _car addAction ["In Fahrzeug ablegen","placeInObj.sqf",nil,1.5,false,false,"","true",5];
  111.             if (_doorState == 1) then
  112.             {
  113.                 _car addAction ["Kofferraum schliessen","openTunk.sqf"];
  114.             }
  115.             else
  116.             {
  117.                 _car addAction ["Kofferraum oeffnen","openTunk.sqf"];
  118.             };
  119.         }
  120.         else
  121.         {
  122.             hint "Fahrzeugtuer ist geschlossen";
  123.         };
  124.     };
  125.  
  126.     //Offroad UNARMED
  127.     case "C_Offroad_01_F":
  128.     {
  129.         _doorState = _car animationPhase "HideDoor3";
  130.         if (_doorState == 1) then
  131.         {
  132.             _handle = false;
  133.             _handle = [[_car],"FNC_MZ_GetOutCar",true,true] call BIS_fnc_MP;
  134.             removeallactions _unit;
  135.             removeallactions _car;
  136.             _car addAction ["In Fahrzeug ablegen","placeInObj.sqf",nil,1.5,false,false,"","true",5];
  137.             if (_doorState == 1) then
  138.             {
  139.             _car addAction ["Kofferraum schliessen","openTunk.sqf"];
  140.             }
  141.             else
  142.             {
  143.             _car addAction ["Kofferraum oeffnen","openTunk.sqf"];
  144.             };
  145.  
  146.         }
  147.         else
  148.         {
  149.         hint "Fahrzeugtuer ist geschlossen";
  150.         };
  151.     };
  152.    
  153.    
  154.     //HURON UNARMED
  155.     case "B_Heli_Transport_03_unarmed_F":
  156.     {
  157.         _doorState = _car doorPhase "Door_rear_source";
  158.         if (_doorState == 1) then
  159.         {
  160.             _handle = false;
  161.             _handle = [[_car],"FNC_MZ_GetOutCar",true,true] call BIS_fnc_MP;
  162.             removeallactions _unit;
  163.             removeallactions _car;
  164.             _car addAction ["In Fahrzeug ablegen","placeInObj.sqf",nil,1.5,false,false,"","true",10];
  165.                 if (_doorState == 1) then
  166.                 {
  167.                     _car addAction ["Kofferraum schliessen","openTunk.sqf"];
  168.                 }
  169.                 else
  170.                 {
  171.                     _car addAction ["Kofferraum oeffnen","openTunk.sqf"];
  172.                 };
  173.        
  174.         }
  175.         else
  176.         {
  177.             hint "Fahrzeugtuer ist geschlossen";
  178.         };
  179.     };
  180.    
  181.     //Stomper NATO
  182.     case "B_UGV_01_F":
  183.     {
  184.         _handle = false;
  185.         _handle = [[_car],"FNC_MZ_GetOutCar",true,true] call BIS_fnc_MP;
  186.         removeallactions _unit;
  187.         removeallactions _car;
  188.         _car addAction ["In Fahrzeug ablegen","placeInObj.sqf",nil,1.5,false,false,"","true",5];
  189.  
  190.     };
  191.    
  192.     //Ifrit UNARMED
  193.         case "O_MRAP_02_F":
  194.     {
  195.         _doorState = _car doorPhase "Door_rear";
  196.         if (_doorState == 1) then
  197.         {
  198.             _handle = false;
  199.             _handle = [[_car],"FNC_MZ_GetOutCar",true,true] call BIS_fnc_MP;
  200.             removeallactions _unit;
  201.             removeallactions _car;
  202.             _car addAction ["In Fahrzeug ablegen","placeInObj.sqf",nil,1.5,false,false,"","true",6];
  203.                 if (_doorState == 1) then
  204.                 {
  205.                     _car addAction ["Kofferraum schliessen","openTunk.sqf"];
  206.                 }
  207.                 else
  208.                 {
  209.                     _car addAction ["Kofferraum oeffnen","openTunk.sqf"];
  210.                 };
  211.        
  212.         }
  213.         else
  214.         {
  215.             hint "Fahrzeugtuer ist geschlossen";
  216.         };
  217.     };
  218.    
  219. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement