Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _jsonStr = _incap call ace_medical_fnc_serializeState;
- _jsonhash = [_jsonStr, 2] call CBA_fnc_parseJSON;
- _woundsHash = _jsonhash get "ace_medical_openwounds";
- // ================= BANDAGE ACTION LOOP ================
- {
- // call again inside loop, so that live player medics healing at same time are updated
- _jsonStr = _incap call ace_medical_fnc_serializeState;
- _jsonhash = [_jsonStr, 2] call CBA_fnc_parseJSON;
- _woundsHash = _jsonhash get "ace_medical_openwounds";
- // seperate bleeding wounds from bruises
- _bleedingwounds = [];
- _bruises = [];
- {
- 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 {
- _bruises = _bruises + [_x];
- } else {
- _bleedingwounds = _bleedingwounds + [_x];
- };
- } forEach _value1;
- while {count _bleedingwounds > 0} do {
- //ACE GET DATA AGAIN
- _jsonStr = _incap call ace_medical_fnc_serializeState;
- _jsonhash = [_jsonStr, 2] call CBA_fnc_parseJSON;
- _woundsHash = _jsonhash get "ace_medical_openwounds";
- _value1 = _woundsHash get _key1;
- sleep 0.5;
- _bleedingwounds = _bleedingwounds - [_bleedingwounds select 0];
- _woundsHash set [_key1, _bleedingwounds + _bruises];
- _jsonhash set ["ace_medical_openwounds", _woundsHash];
- // UPDATE DATA WITH ACE MEDICAL
- _newJsonStr = [_jsonhash] call CBA_fnc_encodeJSON;
- if (local _incap) then {
- [_incap, _newJsonStr] call ace_medical_fnc_deserializeState;
- } else {
- [_incap, _newJsonStr] remoteExec ["ace_medical_fnc_deserializeState", _incap];
- };
- // ANIMATION Kneeling revive - no near enemy
- if (isNull _nearEnemy) then {
- [_medic, "AinvPknlMstpSnonWnonDnon_medic4"] remoteExec ["playMove", _medic];
- sleep 9;
- };
- sleep 1;
- };
- } forEach (keys _woundsHash);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement