Advertisement
READTHESCROLL

S2V.sqf

Sep 22nd, 2015
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 4.39 KB | None | 0 0
  1. /*
  2. /////////////////////////////////////////////////////////////
  3. Strobe 2 Vehicle
  4. Credits:
  5. -Modified version of original EtV by Stealthstick and zooloo75
  6. to allow attaching IR strobe to vehicles.
  7. -Also used Vehicle IR script by Lala14 and Tajin as reference
  8. for creating specific attaching points on vehicle classes.
  9. -Modified by READTHESCROLL
  10. /////////////////////////////////////////////////////////////
  11. INSTALL:
  12. Copy script and place into editor of choice. Save as S2V.sqf
  13.  
  14. Place script in your mission file in a folder called "addons".
  15.  
  16. Paste this at the VERY BOTTOM of init.sqf. Merge with existing
  17. and move to bottom of init.sqf if you already have a
  18. if (!isDedicated and hasInterface) then block.
  19.  
  20. if (!isDedicated and hasInterface) then {
  21.     // waitUntil Client Is Actually Loaded In Game
  22.     waitUntil {!isNil "ExileClientLoadedIn"};
  23.     [] execVM "addons\S2V.sqf";
  24.     // waitUntil S2VInitialized is populated by S2V.sqf
  25.     waitUntil {!isNil "S2VInitialized"};
  26.     [player] call S2V_actions;
  27. };
  28.  
  29. BE FILTERS - Line 1 createvehicle.txt - !="NVG_TargetW"
  30. /////////////////////////////////////////////////////////////
  31. */
  32. S2V_StrobeCheck =
  33. {
  34.  
  35.     _irGrenade = _this select 0;
  36.     _unit = _this select 1;
  37.     _hasIt = _irGrenade in (magazines _unit);
  38.     _nearVehs = nearestObjects [_unit,["Air","Ship","LandVehicle"],5];
  39.  
  40.     _return = (_hasIt && count _nearVehs > 0 && alive _unit); // Add " && !ExilePlayerInSafezone" to disable placing strobe on vehicles in safe zone
  41.     _return
  42. };
  43.  
  44. S2V_AttachStrobe =
  45. {
  46.     _array = _this select 3;
  47.     _irGrenade = _array select 0;
  48.     _unit = _array select 1;
  49.     private "_class";
  50.  
  51.     _unit removeMagazine _irGrenade;
  52.     _unit playMove "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
  53.  
  54.     switch _irGrenade do
  55.     {
  56.         case "B_IR_Grenade":
  57.         {
  58.             _class = "NVG_TargetW";
  59.         };
  60.     };
  61.  
  62.     _nearVehicle = (nearestObjects [_unit,["Air","Ship","LandVehicle"],5]) select 0;
  63.     _irStrobe = _class createVehicle getPos (_nearVehicle);
  64.     _unit setVariable ["irStrobe",_irStrobe,true];
  65.     (_unit getVariable "irStrobe") attachTo [_nearVehicle,[0,0,0]];
  66.     _pos = [0,0,0];
  67.     //CARS
  68.     if (_nearVehicle isKindOf "B_MRAP_01_hmg_F") then { _pos = [0,-1,0]; }; //Hunter HMG
  69.     if (_nearVehicle isKindOf "MRAP_01_base_F") then { _pos = [0,-4.5,0.5]; }; //Hunter
  70.     if (_nearVehicle isKindOf "O_MRAP_02_hmg_F") then { _pos = [0,-4,0.2]; }; //Ifrit HMG
  71.     if (_nearVehicle isKindOf "MRAP_02_base_F") then { _pos = [0,-5,0.5]; }; //Ifrit
  72.     if (_nearVehicle isKindOf "I_MRAP_03_hmg_F") then { _pos = [0,-3.08,0.3]; }; //Strider HMG
  73.     if (_nearVehicle isKindOf "MRAP_03_base_F") then { _pos = [0,-3.08,0.3]; }; //Strider
  74.     if (_nearVehicle isKindOf "Quadbike_01_base_F") then { _pos = [0.3,0.3,-0.5]; };
  75.     if ((_nearVehicle isKindOf "Offroad_01_base_f") OR (_nearVehicle isKindOf "Offroad_01_armed_base_F")) then { _pos = [0,-.4,0.45]; };
  76.     if (_nearVehicle isKindOf "Hatchback_01_base_F") then { _pos = [0,-1.5,0.3]; };
  77.     if (_nearVehicle isKindOf "SUV_01_base_F") then { _pos = [0,0,0.5]; };
  78.     if (_nearVehicle isKindOf "Van_01_base_F") then { _pos = [0,0,1]; };
  79.     if (_nearVehicle isKindOf "Truck_01_base_F") then { _pos = [0,-10,-3]; }; //Zamak
  80.     if (_nearVehicle isKindOf "Truck_02_base_F") then { _pos = [0,2.9,0.5]; }; //Tempest
  81.     if (_nearVehicle isKindOf "Truck_03_base_F") then { _pos = [0,3.2,0.9]; }; //HEMMT
  82.     //HELIS
  83.     if (_nearVehicle isKindOf "Heli_Light_01_base_F") then { _pos = [0,-4.1,-0.2]; }; //Pawnee
  84.     if ((_nearVehicle isKindOf "I_Heli_light_03_unarmed_base_F") OR (_nearVehicle isKindOf "I_Heli_light_03_base_F")) then { _pos = [0,-9,2]; }; //Hellcat
  85.     if ((_nearVehicle isKindOf "Heli_Light_02_base_F") OR (_nearVehicle isKindOf "I_Heli_Transport_02_F")) then { _pos = [0,-9,0]; }; //Orca
  86.     if (_nearVehicle isKindOf "Heli_Transport_04_base_F") then { _pos = [0,-8.95,0]; }; //Taru
  87.     if (_nearVehicle isKindOf "Heli_Transport_02_base_F") then { _pos = [0,-9,0]; }; //Mohawk
  88.     if (_nearVehicle isKindOf "Heli_Transport_01_base_F") then { _pos = [0,-8,0.6]; }; //Ghosthawk
  89.     if (_nearVehicle isKindOf "Heli_Transport_03_base_F") then { _pos = [0,-5.4,0]; }; //Huron
  90.  
  91.  
  92.     (_unit getVariable "irStrobe") attachTo [_nearVehicle,_pos];
  93. };
  94.  
  95.  
  96. S2V_Actions =
  97. {
  98.     private ["_unit"];
  99.     _unit = _this select 0;
  100.  
  101.     _unit addAction ["<t color=""#FFE496"">" +"Attach IR Strobe", S2V_AttachStrobe, ["B_IR_Grenade",_unit], 1, true, true, "","['B_IR_Grenade',_target] call S2V_StrobeCheck"];
  102. };
  103. [player] call S2V_Actions;
  104. S2VInitialized = true;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement