[HELP] Need assistance using SetVehicleJetEngineOn

Hello again guys! Either these documents suck, OR Lua is a piece of turd to script on. I miss C. Anyways, I’m trying to leverage SetVehicleJetEngineOn just like the person did in the video sourced from the native reference itself:

youtu.be/OK0ps2fDpxs

Just like the video, I’m trying to keep the engine ON in the hydra, but it’s not seeming to work for me.
Here’s my client.lua code:

Citizen.CreateThread(function()
        while true do
                Wait(0)
                SetVehicleJetEngineOn('hydra', true)
                end
        end)

So does this just activate the native once? And if so, does it need to be looped?

Remember, I’m not very good with lua so a basic example / explanation will go a LONG way!
Thanks!

P.S. the __resource.lua just has the resource_manifest AND the call for client.lua!

Please let me know!
Thanks!

Vehicle is a vehicle instance, not a string nor a hash. :slight_smile: Try using GetVehiclePedIsUsing or similar.

2 Likes

Hmm! Interesting! That seemed to work marvelously!

Question - Can we talk a bit more about which natives require the Vehicle instance? How did you know that? Is there an indicator on the docs?

Well, my question is:
How do you know what will require a vehicle string / instance / hash? Does ANYTHING that says “Vehicle” mean vehicle instance?

yes, it does

Awesome! One more question if you have the time, that is!

As a separate project, I’m trying to disable the plane engine turning off if you de throttle for about 3 seconds. Do you see this at all possible? I was thinking the GetIsVehicleEngineOn can be leveraged along with the TurnVehicleJetEngineOn native as well, but I’m not 100% on that one!