Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.63 KB | None | 0 0
  1. player setvariable ["c_chemdog_drugged", false];
  2. player setvariable ["c_chemdog_times_drugged", 0];
  3.  
  4. player addEventHandler ["Respawn", {
  5.     player setvariable ["c_chemdog_times_drugged", 0];
  6.     player setvariable ["c_chemdog_drugged", false];
  7. }];
  8.  
  9. _unit = player;
  10.  
  11. _condition = {
  12.    
  13.     "c_chemdog_drug" in items player && {[_player, _target, []] call ace_common_fnc_canInteractWith} && !(player getvariable "c_chemdog_drugged")
  14. };
  15. _statement = {
  16.     playsound "chemdog_inject";
  17.     player removeitem "c_chemdog_drug";
  18.     [] spawn {
  19.        
  20.         [] call {
  21.             sleep 2;
  22.             //systemchat "effect starting";
  23.             _timesDrugged = player getvariable "c_chemdog_times_drugged";
  24.             player setvariable ["c_chemdog_drugged", true];
  25.             player setvariable ["c_chemdog_times_drugged", _timesDrugged + 1];
  26.            
  27.             _chemdog_sharp = ppEffectCreate ["WetDistortion",300];
  28.             _chemdog_sharp ppEffectEnable true;
  29.             _chemdog_sharp ppEffectAdjust [-10,0.5,0.5,0,0,0,0,0,0,0,0,0,0,0,0];
  30.             _chemdog_sharp ppEffectCommit 5;
  31.            
  32.             _chemdog_colorC = ppEffectCreate ["ColorCorrections",1500];
  33.             _chemdog_colorC ppEffectEnable true;
  34.             _chemdog_colorC ppEffectForceInNVG true;
  35.             _chemdog_colorC ppEffectAdjust [1,1,0,[0,0,0,-0.5],[1,1,1,1],[0.33,0.33,0.33,0],[0,0,0,0,0,0,4]];
  36.             _chemdog_colorC ppEffectCommit 5;
  37.                    
  38.            
  39.             playSound "chemdog_heart_fast_1";
  40.             sleep 0.5;
  41.             playSound "chemdog_heart_fast_1";
  42.             sleep 0.5;
  43.             playSound "chemdog_heart_fast_1";
  44.             sleep 0.5;
  45.             playSound "chemdog_heart_fast_1";
  46.             sleep 0.5;
  47.             playSound "chemdog_heart_fast_1";
  48.             sleep 0.5;
  49.            
  50.             if (player getvariable "c_chemdog_times_drugged" > 3) then {
  51.                
  52.             playSound "chemdog_heart_fast_1";
  53.             sleep 0.5;
  54.             playSound "chemdog_heart_fast_1";
  55.             sleep 0.5;
  56.             playSound "chemdog_heart_fast_1";
  57.             sleep 0.5;
  58.             playSound "chemdog_heart_fast_1";
  59.             sleep 0.5;
  60.             playSound "chemdog_heart_fast_1";
  61.             sleep 0.5;
  62.             playSound "chemdog_heart_fast_1";
  63.             sleep 0.5;
  64.            
  65.             } else {
  66.                
  67.             playSound "chemdog_heart_fast_2";
  68.             sleep 0.5;
  69.             playSound "chemdog_heart_fast_3";
  70.             sleep 0.5;
  71.             playSound "chemdog_heart_fast_4";
  72.             sleep 0.5;
  73.             playSound "chemdog_heart_fast_5";
  74.             sleep 0.5;
  75.             playSound "chemdog_heart_fast_6";
  76.             sleep 0.5;
  77.             playSound "chemdog_heart_fast_7";
  78.             sleep 0.5;
  79.            
  80.             };
  81.            
  82.            
  83.             if (player getvariable "c_chemdog_drugged") then {
  84.                 [objNull, player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;
  85.                 player setAnimSpeedCoef 1.6;
  86.                 player enableStamina false;
  87.                
  88.                 [] spawn {
  89.                     [] call {
  90.                             ////systemchat format ["Drugs active: %1", player getvariable "c_chemdog_times_drugged"];
  91.                             if (player getvariable "c_chemdog_times_drugged" > 3) then {
  92.                                 player setdamage 1;
  93.                             };
  94.                             sleep 600;
  95.                             if (player getvariable "c_chemdog_times_drugged" > 0) then {
  96.                                 _timesDrugged = player getvariable "c_chemdog_times_drugged";
  97.                                 player setvariable ["c_chemdog_times_drugged", _timesDrugged - 1];
  98.                             };
  99.                             ////systemchat format ["Drugs active: %1 ", player getvariable "c_chemdog_times_drugged"];
  100.                     };
  101.                 }; 
  102.                
  103.                 //hint "heal 1";
  104.                 sleep 5;
  105.             };
  106.            
  107.             if (player getvariable "c_chemdog_drugged") then {
  108.                 [objNull, player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;
  109.                 //hint "heal 2";
  110.                 sleep 5;
  111.             };
  112.             if (player getvariable "c_chemdog_drugged") then {
  113.                 [objNull, player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;
  114.                 //hint "heal 3";
  115.                 sleep 5;
  116.             };
  117.             if (player getvariable "c_chemdog_drugged") then {
  118.                 [objNull, player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;
  119.                 //hint "heal 4";
  120.                 sleep 5;
  121.             };
  122.             if (player getvariable "c_chemdog_drugged") then {
  123.                 [objNull, player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;
  124.                 //hint "heal 5";
  125.                 sleep 5;
  126.             };
  127.             if (player getvariable "c_chemdog_drugged") then {
  128.                 [objNull, player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;
  129.                 //hint "heal 6";
  130.                 sleep 5;
  131.             };
  132.             if (player getvariable "c_chemdog_drugged") then {
  133.                 [objNull, player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;
  134.                 //hint "heal 7";
  135.                 sleep 5;
  136.             };
  137.             if (player getvariable "c_chemdog_drugged") then {
  138.                 [objNull, player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;
  139.                 //hint "heal 8";
  140.                 sleep 5;
  141.             };
  142.             if (player getvariable "c_chemdog_drugged") then {
  143.                 [objNull, player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;
  144.                 //hint "heal 9";
  145.             };
  146.            
  147.             if (player getvariable "c_chemdog_drugged") then {
  148.                 _chemdog_colorC ppEffectAdjust [1,1,0,[0,0,0,0],[1,1,1,1],[0.33,0.33,0.33,0],[0,0,0,0,0,0,4]];
  149.                 _chemdog_colorC ppEffectCommit 5;
  150.                 _chemdog_sharp ppEffectAdjust [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
  151.                 _chemdog_sharp ppEffectCommit 5;
  152.             };
  153.            
  154.             if (!(player getvariable "c_chemdog_drugged")) then {
  155.                 player setAnimSpeedCoef 1;
  156.                 player enableStamina true;
  157.                 ppEffectDestroy [_chemdog_colorC,_chemdog_sharp];
  158.                 player setvariable ["c_chemdog_drugged", false];
  159.                 ////systemchat format ["Drugs active: %1", player getvariable "c_chemdog_drugged"];
  160.             };
  161.            
  162.             if (player getvariable "c_chemdog_drugged") then {
  163.                 sleep 4;
  164.                 player setAnimSpeedCoef 1;
  165.                 player enableStamina true;
  166.                 sleep 1;
  167.                 player setStamina 0;
  168.                 ppEffectDestroy [_chemdog_colorC,_chemdog_sharp];
  169.                 player setvariable ["c_chemdog_drugged", false];
  170.             };
  171.         };
  172.     };
  173. };
  174. _action = ["C_UseDrug","Use Drug","",_statement,_condition] call ace_interact_menu_fnc_createAction;
  175.  
  176. [(typeOf _unit), 1, ["ACE_SelfActions","ACE_Equipment"], _action, true] call ace_interact_menu_fnc_addActionToClass;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement