[Release] vEngine v1.2 | Simple engine toggle on button press (F6)


#22

Update v1.2

Changelog:


#23

New update works perfectly now i can use Lux control and on police cars and ya works on all cars now as well…


#24

any chance of getting this script to leave the vehicle running when you get out


#25

No I’m not planning on adding that. However it shouldn’t be hard to create such script, just loop every frame and check

IsPedInAnyVehicle(PlayerPedId(), false)

and keep track of when that returns true. Then as soon as it becomes false, get the last vehicle using

local lastVehicle = GetVehiclePedIsIn(PlayerPedId(), true)

and check if the vehicle still exists and isn’t dead/broken and toggle the engine on:

if DoesEntityExist(lastVehicle) and not IsEntityDead(lastVehicle) then
    SetVehicleEngineOn(lastVehicle, true, false, true)
end

Hope this explains it well enough.


#26

What is the Local Button number for " j " ?

I want to put the Engine Toggle on button " j ".


#27

I don’t think you can, as there’s no button/control mapped to J.


#28

ill try and figure it out with what you gave me. if no luck it wasn’t meant to be. thanks.


#29

Is there a way to make the cars spawn in on and then turn it off or on as you please?


#30

That’s the job of whoever created the resource/mod/trainer that you use to spawn the cars. As this resource just provides a button to toggle the engine on/off when you are inside the vehicle. I can’t “check” for an event when a vehicle is spawned and it needs to be turned on. There might be a way but it’d just over-complicate this resource a lot and it could be very easily done in the script that you use to spawn the car in the first place.


#31

Having a hot key to turn the engine off is a great mod. Thanks


#32

This would be more useful if the engine kept running when one exits vehicle. Any plans on incorporating that?


#33

Hey any way you can add the code making the car stay running when exit vehicle? it stops running soon as i exit (when not using F6)


#34

Not going to add this in this resource. However I’m working on a large project right now, in which I will make sure to implement this as an option.


#35

there already is one that has it in it, though it’s been activated by using /engine which isn’t what i want, therefor wanted your script with that line in it, just can’t get it to work : /

thanks for the reply


#36

It won’t be in this one, but it will be in my other project. I’m going going to give out too many details yet because a lot of it will probably still change. But it’s quite a big project and I want it to be more than decent, so it will take some time.


#37

Alright, i’ll keep an eye on your channel, thanks for the headsup


#39

Would be cool to see the engine turn on when you gave throttle when its off.


#40

Does this script not work with addon vehicles. any vehicle that is not the original slot will not turn off.


#41

Nice when cops use controllers and turn there lights on it turns the car off…


#42

Stop using custom broken controls then. The default works just fine if you use controller or keyboard/mouse. (Of course, don’t use keyboard/mouse and controller at the exact same time because the game will then think the controller is a keyboard/mouse for script inputs)