DoesVehicleTyreExist native broken? (Always returns false)

The native DoesVehicleTyreExist does not work at all… It always returns false.

I used the following code to test this out as a client sided script:

-- Define wheel bones and indices
local tireBones = {"wheel_lf", "wheel_rf", "wheel_lm", "wheel_rm", "wheel_lr", "wheel_rr"}
local tireIndices = {
    ["wheel_lf"] = 0,
    ["wheel_rf"] = 1,
    ["wheel_lm"] = 2,
    ["wheel_rm"] = 3,
    ["wheel_lr"] = 4,
    ["wheel_rr"] = 5,
}

-- Register a key mapping for the E key
RegisterCommand('checkVehicleWheels', function()
    -- Get the player's vehicle
    local playerPed = PlayerPedId()
    local vehicle = GetVehiclePedIsIn(playerPed, false)

    if vehicle and vehicle ~= 0 then
        print("Checking vehicle wheels...")
        for _, bone in ipairs(tireBones) do
            local index = tireIndices[bone]
            if index then
                -- Check if the tire exists
                if DoesVehicleTyreExist(vehicle, index) then
                    print(string.format("Tire '%s' (Index: %d) exists.", bone, index))
                else
                    print(string.format("Tire '%s' (Index: %d) is missing.", bone, index))
                end
            end
        end
    else
        print("Player is not in a vehicle.")
    end
end, false)

-- Bind the E key to the command
RegisterKeyMapping('checkVehicleWheels', 'Check Vehicle Wheels', 'keyboard', 'E')

If you’re looking for a workaround, you can check the position of the bone of the tire on the vehicle. If the position is 0,0,0 you know the wheel doesn’t belong to that vehicle.

Example:

Vehicle vehicle = Game.PlayerPed.LastVehicle;
Vector3 wheelPosition = vehicle.Bones["wheel_lf"].Position;

// Wheel does not belong to vehicle (i.e. truck wheel)
if (wheelPosition == Vector3.Zero)
{
    ...
    return;
}

// Wheel does belong

float distance = wheelPosition.DistanceTo(vehicle.Position);

// Wheel is detached from vehicle
if (distance > 5f)
{
    ...
    return;
}

// Wheel still attached to vehicle

since they’ve touched the wheel, there’s been a discrepancy between the wheel indexes and the tyre indexes.
Here is the current correspondence

Wheel Tyre
0 0
1 1
2 4
3 5
4 2
5 3
6 691
7 692

We use this IsVehicleTyreBurst to check tyre

if IsVehicleTyreBurst(veh,tyreIndex,false) or GetVehicleWheelHealth(veh,wheelIndex) == 0 then
    numberWheelBrake = numberWheelBrake + 1
end

This is for Tyres burst though, not wheels missing off a vehicle?

Interesting idea, I’ll try this out, thanks.