Skip to content

getVehicleWheelFrictionState not working on bikes #3955

Open
@thealex-br

Description

@thealex-br

Describe the bug

getVehicleWheelFrictionState throws ERROR: script/file.lua:line Invalid vehicle type when used in non "Automobile" vehicle types, this function is very useful to detect vehicle behavior and should work in all vehicle types, or return false instead

Steps to reproduce

  1. enable debugscript 3

  2. run:

addEventHandler("onClientRender", root, function ()
    local veh = getPedOccupiedVehicle (localPlayer)
    
    if not veh then
        return false
    end
    
    dxDrawRectangle (0, 0, 300, 140, tocolor (0, 0, 0, 150))
    dxDrawText ("FRICTION FRONT LEFT = ".. getVehicleWheelFrictionState (veh, 0), 8, 10, 290, 40, tocolor (255, 255, 255), 1.5)
    dxDrawText ("FRICTION FRONT RIGHT = ".. getVehicleWheelFrictionState (veh, 2), 8, 40, 290, 70, tocolor (255, 255, 255), 1.5)
    dxDrawText ("FRICTION REAR LEFT = ".. getVehicleWheelFrictionState (veh, 1), 8, 70, 290, 100, tocolor (255, 255, 255), 1.5)
    dxDrawText ("FRICTION REAR RIGHT = ".. getVehicleWheelFrictionState (veh, 3), 8, 100, 290, 130, tocolor (255, 255, 255), 1.5)
end)
  1. enter a bike
  2. see errors

Version

Client: v1.6-release-22894 (Windows 10, 64-bit)
Server: v1.6-release-22649 (Linux, 64-bit)

Additional context

No response

Relevant log output

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions