Driveable is true

Hello,
I have a small problem with the function “IsVehicleDriveable”, it makes me real even if I set “SetVehicleUndriveable” to false.

Code:

...
	if engine then
		Citizen.Trace("-------- Engine on --------- \n")
	else
		Citizen.Trace("-------- Engine off --------- \n")
	end


		if IsVehicleDriveable(self.id) then
			Citizen.Trace("-------- Driveable on --------- \n")
		else
			Citizen.Trace("-------- Driveable onf --------- \n")
		end

  if IsVehicleEngineOn(self.id) and fuelLevel > 0 then
		...
  elseif engine and fuelLevel <= 0 then
		engine = false
    SetVehicleUndriveable(self.id, true)
    SetVehicleEngineOn(self.id, false, false, true)
  elseif not engine and fuelLevel > 0 then
    engine = true
    SetVehicleUndriveable(self.id, false)
		SetVehicleEngineOn(self.id, true, false, true)
  end

Put traces all through the code and see which one prints. Looks like engine is being set to false so one of those engine = false is setting.

If I understand correctly, if you want the vehicle to be undrivable, you should set SetVehicleUndriveable to true.

I want both to be false. The car can not be driven.

SetVehicleUNdriveable would have to be true.

	if not engine and IsVehicleDriveable(self.id) then
		Citizen.Trace("-------- Set To undriveable --------- \n")
		SetVehicleUndriveable(self.id, true)
	end

IsVehicleDriveable remains true even when SetVehicleUndriveable is set to true. What to do ?

I have the same problem with my script:

SetVehicleUndriveable(vehicle, true)
print(IsVehicleDriveable(vehicle, 0))

And in console the output of the print-statement is always the value “1”.

I do not understand why !?

I also tried this way:

SetVehicleUndriveable(vehicle, false)
print(IsVehicleDriveable(vehicle, 0))

But the console output is also always the value “1”.

Native Documentation says:

IsVehicleDriveable(vehicle: Vehicle, isOnFireCheck: boolean): boolean
p1 is always 0 in the scripts. p1 = check if vehicle is on fire

So I tried this:

SetVehicleUndriveable(vehicle, false)
print(IsVehicleDriveable(vehicle, IsVehicleEngineOnFire(vehicle)))

But as before the console output is also always the value “1”.

I do not understand what to do or to change to get a real indication if the vehicle is driveable.