Advertisement
bendy303

Untitled

Jan 23rd, 2024 (edited)
917
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.92 KB | Gaming | 0 0
  1.          _jsonStr = _incap call ace_medical_fnc_serializeState;        
  2.          _jsonhash = [_jsonStr, 2] call CBA_fnc_parseJSON;  
  3.          _woundsHash = _jsonhash get "ace_medical_openwounds";
  4.          
  5. // ================= BANDAGE ACTION LOOP ================
  6. {
  7.         // call again inside loop, so that live player medics healing at same time are updated
  8.          _jsonStr = _incap call ace_medical_fnc_serializeState;        
  9.          _jsonhash = [_jsonStr, 2] call CBA_fnc_parseJSON;
  10.          _woundsHash = _jsonhash get "ace_medical_openwounds";
  11.  
  12.         // seperate bleeding wounds from bruises
  13.         _bleedingwounds = [];
  14.         _bruises = [];         
  15.         {
  16.             if (_x select 0 == 20 || _x select 0 == 21 || _x select 0 == 22 || _x select 0 == 80 || _x select 0 == 81 || _x select 0 == 82 ) then {
  17.             _bruises = _bruises + [_x];
  18.             } else {
  19.             _bleedingwounds = _bleedingwounds + [_x];
  20.             };
  21.         } forEach _value1;
  22.            
  23.         while {count _bleedingwounds > 0} do { 
  24.        
  25.                 //ACE GET DATA AGAIN
  26.                  _jsonStr = _incap call ace_medical_fnc_serializeState;    
  27.                  _jsonhash = [_jsonStr, 2] call CBA_fnc_parseJSON;
  28.                  _woundsHash = _jsonhash get "ace_medical_openwounds";             
  29.                
  30.                  _value1 = _woundsHash get _key1;
  31.                  
  32.                 sleep 0.5;
  33.  
  34.                 _bleedingwounds = _bleedingwounds - [_bleedingwounds select 0];
  35.                 _woundsHash set [_key1, _bleedingwounds + _bruises];                                                                               
  36.                 _jsonhash set ["ace_medical_openwounds", _woundsHash];
  37.                    
  38.                 // UPDATE DATA WITH ACE MEDICAL
  39.                 _newJsonStr  = [_jsonhash] call CBA_fnc_encodeJSON;
  40.                 if (local _incap) then {
  41.                     [_incap, _newJsonStr] call ace_medical_fnc_deserializeState;
  42.                 } else {
  43.                     [_incap, _newJsonStr] remoteExec ["ace_medical_fnc_deserializeState", _incap];
  44.                 };
  45.            
  46.                 // ANIMATION Kneeling revive - no near enemy
  47.                 if (isNull _nearEnemy) then {
  48.                 [_medic, "AinvPknlMstpSnonWnonDnon_medic4"] remoteExec ["playMove", _medic];
  49.                 sleep 9;
  50.                 };
  51.                
  52.         sleep 1;
  53.         };     
  54.    
  55. } forEach (keys _woundsHash);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement