diff --git a/SQF/dayz_code/medical/SQF/dayz_code/medical/load/load_act.sqf b/SQF/dayz_code/medical/SQF/dayz_code/medical/load/load_act.sqf new file mode 100644 index 000000000..557825ba4 --- /dev/null +++ b/SQF/dayz_code/medical/SQF/dayz_code/medical/load/load_act.sqf @@ -0,0 +1,23 @@ +// Load_act.sqf +// JULY 2010 - norrin +// Updated December 2019 - JasonTM + +private ["_args","_medic","_vcl","_wounded"]; + +_args = _this select 3; +_medic = _args select 0; +_vcl = _args select 1; +_wounded = _args select 2; + +r_action = false; +call fnc_usec_medic_removeActions; + +if ((_vcl emptyPositions "cargo") > 0) then { + + // Send information to start the load process + PVDZ_send = [_wounded,"LoadWounded",[_wounded,_medic,_vcl],[_wounded,dayz_authKey,_medic]]; + publicVariableServer "PVDZ_send"; +} else { + localize "str_dragnospace" call dayz_rollingMessages; // "No space left in vehicle" +}; + diff --git a/SQF/dayz_code/medical/SQF/dayz_code/medical/load/load_wounded.sqf b/SQF/dayz_code/medical/SQF/dayz_code/medical/load/load_wounded.sqf new file mode 100644 index 000000000..d01a6d704 --- /dev/null +++ b/SQF/dayz_code/medical/SQF/dayz_code/medical/load/load_wounded.sqf @@ -0,0 +1,40 @@ +// Load_wounded.sqf +// OCTOBER 2010 - norrin +// Updated December 2019 - JasonTM + +private ["_wounded","_vehicle","_group","_medic"]; + +_wounded = _this select 0; +_medic = _this select 1; +_vehicle = _this select 2; + +// Check to see that the first passed object matches local player object +if (player != _wounded) exitWith {}; +if !(r_player_unconscious) exitWith {}; + +_wounded assignAsCargo _vehicle; +_wounded moveInCargo _vehicle; + +// Animation needs to be synced on all clients. +[nil, _wounded, rSWITCHMOVE, "KIA_HMMWV_Cargo01"] call RE; +_wounded switchMove "KIA_HMMWV_Cargo01"; + +r_drag_sqf = true; + +while {r_drag_sqf} do { + + // If the player wakes up, end the loop. + if (!(_wounded getVariable ["NORRN_unconscious", false])) then { + + uiSleep 2; // Give fn_unconsious time to finish + + if (vehicle _wounded != _wounded) then { + // fn_unconscious does not perform an animation if the player is in a vehicle. + [nil, _wounded, rSWITCHMOVE, "HMMWV_Cargo01"] call RE; + _wounded switchMove "HMMWV_Cargo01"; + }; + + r_drag_sqf = false; + }; + uiSleep 1; +}; \ No newline at end of file diff --git a/SQF/dayz_code/medical/SQF/dayz_code/medical/load/unLoad_act.sqf b/SQF/dayz_code/medical/SQF/dayz_code/medical/load/unLoad_act.sqf new file mode 100644 index 000000000..9ec173726 --- /dev/null +++ b/SQF/dayz_code/medical/SQF/dayz_code/medical/load/unLoad_act.sqf @@ -0,0 +1,30 @@ +// unLoad_act.sqf +// AUGUST 2010 - norrin +// Updated December 2019 - JasonTM + +private ["_args","_unconscious_crew","_vehicle","_pos","_wounded","_medic"]; + +_args = _this select 3; +_medic = _args select 0; +_unconscious_crew = _args select 1; +_vehicle = _args select 2; +_pos = [_vehicle] call FNC_GetPos; + +r_action = false; +call fnc_usec_medic_removeActions; + +// Prevent trolling unconscious players by checking that the position is not over water. +if !(surfaceIsWater _pos) then { + { + _wounded = _x; + unassignVehicle _wounded; + _wounded action ["EJECT", _vehicle]; + + // Send information to reestablish the "lie on back" animation + PVDZ_send = [_wounded,"UnloadWounded",_wounded,[_pos,dayz_authKey,_medic]]; + publicVariableServer "PVDZ_send"; + + } count _unconscious_crew; +} else { + localize "str_actions_unload_fail" call dayz_rollingMessages; +}; diff --git a/SQF/dayz_code/medical/SQF/dayz_code/medical/load/unload_wounded.sqf b/SQF/dayz_code/medical/SQF/dayz_code/medical/load/unload_wounded.sqf new file mode 100644 index 000000000..7159c1485 --- /dev/null +++ b/SQF/dayz_code/medical/SQF/dayz_code/medical/load/unload_wounded.sqf @@ -0,0 +1,18 @@ +// unload_wounded.sqf +// December 2019 - JasonTM + +private "_wounded"; + +_wounded = _this; + +// Check to see that the passed object matches local player object +if (player != _wounded) exitWith {}; + +// Check if the player is still unconscious +if (r_player_unconscious) then { + // Reestablish the "lie on back" animation + [nil, _wounded, rSWITCHMOVE, "ainjppnemstpsnonwrfldnon"] call RE; + _wounded switchmove "ainjppnemstpsnonwrfldnon"; +}; + +r_drag_sqf = false; \ No newline at end of file