Skip to content

Commit

Permalink
Fixed engine turning on even if it was off
Browse files Browse the repository at this point in the history
  • Loading branch information
ToastinYou committed Nov 16, 2017
1 parent 3f85f61 commit 0e2d5ea
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ Citizen.CreateThread(function()
Citizen.Wait(0)

local ped = GetPlayerPed(-1)

if DoesEntityExist(ped) and IsPedInAnyVehicle(ped, false) and IsControlPressed(2, 75) and not IsEntityDead(ped) and not IsPauseMenuActive() then
local engineWasRunning = GetIsVehicleEngineRunning(GetVehiclePedIsIn(ped, true))
Citizen.Wait(1000)
if DoesEntityExist(ped) and not IsPedInAnyVehicle(ped, false) and not IsEntityDead(ped) and not IsPauseMenuActive() then
local veh = GetVehiclePedIsIn(ped, true)
SetVehicleEngineOn(veh, true, true, true)
if (engineWasRunning) then
SetVehicleEngineOn(veh, true, true, true)
end
end
end
end
Expand Down

0 comments on commit 0e2d5ea

Please sign in to comment.