GetVehicleLightsState client-side at least always returns false

  1. Client (production/canary) and FXServer version:
    – FiveM ver. Release, Server ver.5181

  2. What you expected to happen:
    – True data about the state of the headlights:

  3. What actually happens
    – Native returns false

  4. Category of bug:
    – Native.

  5. Reproducible steps, preferably with example script(s):
    – Create veh and get in;
    – Push the Headlight switch button (H);
    – Enter command with script (below) in console.

Script:

[Command("lights")]
private void GetLightsState()
{
    bool lightsOn = false;
    bool highbeamsOn = false;

    GetVehicleLightsState(LocalPlayer.Character.CurrentVehicle.Handle, ref lightsOn, ref highbeamsOn);
    
    Debug.WriteLine($"lightsOn: {lightsOn}. highbeamsOn: {highbeamsOn}");
}

This works fine on my end, try:
GetVehicleLightsState(Game.Player.Character.CurrentVehicle.Handle, ref lightsOn, ref highbeamsOn);

@markyy for me it works fine