diff --git a/SQF/dayz_code/init/veh_resetEH.sqf b/SQF/dayz_code/init/veh_resetEH.sqf index 7eb621592..b17ac1592 100644 --- a/SQF/dayz_code/init/veh_resetEH.sqf +++ b/SQF/dayz_code/init/veh_resetEH.sqf @@ -13,7 +13,7 @@ if (isServer) then { _this removeAllEventHandlers "GetOut"; _this removeAllEventHandlers "GetIn"; _this addEventHandler ["GetOut", {[(_this select 0),"all"] call server_updateObject;}]; - _this addEventHandler ["GetIn", {[(_this select 0),"all"] call server_updateObject;}]; + _this addEventHandler ["GetIn", {[(_this select 0),"all"] call server_updateObject; _this call server_checkIfTowed;}]; }; //diag_log(format["%1: all EH reset for %2", __FILE__, _this]); \ No newline at end of file diff --git a/SQF/dayz_server/init/server_functions.sqf b/SQF/dayz_server/init/server_functions.sqf index cc1bff0d7..185914b62 100644 --- a/SQF/dayz_server/init/server_functions.sqf +++ b/SQF/dayz_server/init/server_functions.sqf @@ -180,6 +180,18 @@ server_hiveReadWriteLarge = { _resultArray }; +server_checkIfTowed = { + private ["_vehicle","_player","_attached"]; + if (DZE_HeliLift) then { + _vehicle = _this select 0; + _player = _this select 2; + _attached = _vehicle getVariable["attached",false]; + if ((typeName _attached == "OBJECT")) then { + _player action [ "eject", _vehicle)]; + }; + }; +}; + server_characterSync = { private ["_characterID","_playerPos","_playerGear","_playerBackp","_medical","_currentState","_currentModel","_key"]; _characterID = _this select 0;