diff --git a/scripts/client/vehicle.js b/scripts/client/vehicle.js index 5d185e08..259c64dd 100644 --- a/scripts/client/vehicle.js +++ b/scripts/client/vehicle.js @@ -171,4 +171,27 @@ function removeVehiclesFromClient() { getServerData().vehicles.splice(0); } +// =========================================================================== + +function processLocalPlayerVehicleControlState() { + if (areServerElementsSupported()) { + if (localPlayer.vehicle != null) { + if (doesEntityDataExist(localPlayer.vehicle, "v.rp.engine")) { + if (getEntityData(localPlayer.vehicle, "v.rp.engine") == false) { + setImmediate(function () { + localPlayer.vehicle.engine = getEntityData(localPlayer.vehicle, "v.rp.engine"); + }); + + if (!getEntityData(localPlayer.vehicle, "v.rp.engine")) { + if (typeof localPlayer.vehicle.velocity != "undefined") { + localPlayer.vehicle.velocity = toVector3(0.0, 0.0, 0.0); + localPlayer.vehicle.turnVelocity = toVector3(0.0, 0.0, 0.0); + } + } + } + } + } + } +} + // =========================================================================== \ No newline at end of file