function engine()
local vehicle = getPedOccupiedVehicle(localPlayer)
if isElement(vehicle) and getPedOccupiedVehicleSeat(localPlayer) == 0 then
local state = getVehicleEngineState(vehicle)
if not state then
startTimer =
setTimer(
function()
if isElement(vehicle) and getPedOccupiedVehicleSeat(localPlayer) == 0 then
setVehicleEngineState(vehicle, true)
end
end
, 2000, 1)
else
setVehicleEngineState(vehicle, false)
end
end
end
function resetEngine()
if isTimer(startTimer) then killTimer(startTimer) end
end
bindKey("2", "down", engine)
bindKey("2", "up", resetEngine)