Advertisement
skotracker

kkdrop

Apr 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 2.72 KB | None | 0 0
  1. if (!isDedicated) then {
  2.     KK_fnc_FX = {
  3.         private "_veh";
  4.         _veh = _this select 0;
  5.         _vel = _this select 1;
  6.         for "_i" from 1 to 100 do {
  7.             drop [
  8.                 ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 7, 48],
  9.                 "",
  10.                 "Billboard",
  11.                 0,
  12.                 1 + random 0.5,
  13.                 [0, -2, 1.5],
  14.                 [-20 + random 40, -20 + random 40, -15 + _vel],
  15.                 1,
  16.                 0.05,
  17.                 0.04,
  18.                 0,
  19.                 [0.5, 10 + random 20],
  20.                 [
  21.                     [0,0,0,1],
  22.                     [0,0,0,0.3],
  23.                     [1,1,1,0.1],
  24.                     [1,1,1,0.03],
  25.                     [1,1,1,0.01],
  26.                     [1,1,1,0.003],
  27.                     [1,1,1,0.001],
  28.                     [1,1,1,0]
  29.                 ],
  30.                 [1],
  31.                 0.1,
  32.                 0.1,
  33.                 "",
  34.                 "",
  35.                 _veh,
  36.                 random 360,
  37.                 true,
  38.                 0.1
  39.             ];
  40.         };
  41.     };
  42.     "#FX" addPublicVariableEventHandler {_this select 1 spawn KK_fnc_FX};
  43. };
  44. if (isServer) then {
  45.     KK_fnc_paraDrop = {
  46.         private ["_class","_para","_paras","_p","_veh","_vel","_time"];
  47.         _class = format [
  48.             "%1_parachute_02_F",
  49.             toString [(toArray faction _this) select 0]
  50.         ];
  51.         _para = createVehicle [_class, [0,0,0], [], 0, "FLY"];
  52.         _para setDir getDir _this;
  53.         _para setPos getPos _this;
  54.         _paras =  [_para];
  55.         _this attachTo [_para, [0,2,0]];
  56.         {
  57.             _p = createVehicle [_class, [0,0,0], [], 0, "FLY"];
  58.             _paras set [count _paras, _p];
  59.             _p attachTo [_para, [0,0,0]];
  60.             _p setVectorUp _x;
  61.         } count [
  62.             [0.5,0.4,0.6],[-0.5,0.4,0.6],[0.5,-0.4,0.6],[-0.5,-0.4,0.6]
  63.         ];
  64.         0 = [_this, _paras] spawn {
  65.             _veh = _this select 0;
  66.             waitUntil {getPos _veh select 2 < 4};
  67.             _vel = velocity _veh;
  68.             detach _veh;
  69.             _veh setVelocity _vel;
  70.             missionNamespace setVariable ["#FX", [_veh, _vel select 2]];
  71.             publicVariable "#FX";
  72.             playSound3D [
  73.                 "a3\sounds_f\weapons\Flare_Gun\flaregun_1_shoot.wss",
  74.                 _veh
  75.             ];
  76.             {
  77.                 detach _x;
  78.                 _x disableCollisionWith _veh;  
  79.             } count (_this select 1);
  80.             _time = time + 5;
  81.             waitUntil {time > _time};
  82.             {
  83.                 if (!isNull _x) then {deleteVehicle _x};
  84.             } count (_this select 1);
  85.         };
  86.     };
  87. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement