[Release] Engine ON/OFF Toggle

engine
toggle
chatcommand

#126

i have a problem , the engine turns back on on itself , seconds after i shut it down . it started doing this after fivem update


#127

Same for me :frowning:


#128

same here… hope someone has a solution.


#129

Did anyone ever find a way to make this work properly with advancedFuel? The car stays on and you can drive away while it fuels.


#130

From my current testings it works with the latest stable server version of FiveM that dates back to the start of the month.

The car turns off and on like intended, going to do abit more testing.


#131

me too…

Have you a fix ?


#132

Hey guys ! I got a little fix for you, it work for me

function EngineToggle()
    player = GetPlayerPed(-1)
    local vehicle = GetVehiclePedIsIn(player, false)
    if IsVehicleEngineOn(vehicle) then
        SetVehicleEngineOn(vehicle, false, false, true)
        SetVehicleUndriveable(vehicle, true)
    else
        SetVehicleEngineOn(vehicle, true, false, true)
        SetVehicleUndriveable(vehicle, false)
    end
end

Just need to add some “SetVehicleUndriveable” :wink:

Hope it help you !


#133

So much desync witch this script :frowning:


#134

i use https://github.com/iEns/RealisticVehicleFailure and your script glitches it out. the car wont fail. how can i fix that


#135

There is no problem with it.
INPUT_VEH_CINEMATIC_DOWN_ONLY, MOUSE - SCROLL DOWN, NUMPAD +

The Key is {97}, it contains MouseScroll(Down) and NUMPAD +.
Enjoy


#136
-- Change 'false' to 'true' to toggle the engine automatically on when entering a vehicle
OnAtEnter = false

-- Change 'false' to 'true' to use a key instead of a button
UseKey = true

if UseKey then
	-- Change this to change the key to toggle the engine (Other Keys at wiki.fivem.net/wiki/Controls)
	ToggleKey = /engine 
end

is that right I want the command /engine to turn “engine on”


#137

No. You need toset UseKey to false then go to cliente.lua and change IsControlPressed for a chat command


#138

My cars are not turning on…


#139

No… just set UseKey to false and it will work with the command /engine


#140

Can you write an edit that makes it compatible with:


[Release] Realistic Vehicle Failure
#141

I’m having a problem, when I turn off the car and leave it the same keeps turning it on and off. How to fix?


#142

its incompatible with esx_aiomenu and any vehicle failure script and fuel script


#143

but how to fix?