diff --git a/ReallifeGamemode.Client/vehiclesync/vehiclesync.ts b/ReallifeGamemode.Client/vehiclesync/vehiclesync.ts index 461ea0fd..2e349360 100644 --- a/ReallifeGamemode.Client/vehiclesync/vehiclesync.ts +++ b/ReallifeGamemode.Client/vehiclesync/vehiclesync.ts @@ -10,13 +10,17 @@ game.events.add('SERVER:Vehicle:UpdateData', (vehId, dataStr) => { setVehicleData(vehicle, data); }); +game.events.add("SERVER:Vehicle:SetDefaultEngineBehavior", () => { + mp.game.vehicle.defaultEngineBehaviour = false; +}); + game.events.onPlayerEnterVehicle((vehicle, seat) => { while (!game.players.local.inVehicle) { game.wait(0); } if (vehicle) { - var data: VehicleData = vehicle.getSharedData("VehicleData"); + var data: VehicleData = vehicle.getSharedData("VehicleData"); setVehicleData(vehicle, data); if (vehicle.class == 16) mp.game.vehicle.defaultEngineBehaviour = true; } diff --git a/ReallifeGamemode.Server/Job/PilotJob.cs b/ReallifeGamemode.Server/Job/PilotJob.cs index cab36fea..03344205 100644 --- a/ReallifeGamemode.Server/Job/PilotJob.cs +++ b/ReallifeGamemode.Server/Job/PilotJob.cs @@ -152,6 +152,8 @@ namespace ReallifeGamemode.Server.Job private void _JobStop(Player player) { + player.TriggerEvent("SERVER:Vehicle:SetDefaultEngineBehavior"); + if (!playerVehiclePair.ContainsKey(player)) return;