Skip to content

getPedControlState returns true for zoom_out when zooming in, and vice versa #2570

@bum8hj

Description

@bum8hj

Describe the bug
Zoom controls are inverted

  • When zooming in with the sniper, getPedControlState(localPlayer, "zoom_out") returns true.
  • When zooming out with the sniper, getPedControlState(localPlayer, "zoom_in") returns true.

To reproduce
Run this code and try zooming in and out with your sniper.

addEventHandler("onClientRender", root, function()
    dxDrawText("zoom_in: " .. (getPedControlState(localPlayer, "zoom_in") and "true" or "-"), 500, 500)
    dxDrawText("zoom_out: " .. (getPedControlState(localPlayer, "zoom_out") and "true" or "-"), 500, 515)
end)

Expected behaviour
When zooming in, getPedControlState(localPlayer, "zoom_in") should return true, and vice versa.

Video
https://github.com/multitheftauto/mtasa-blue/assets/27828549/3b0d3b09-b270-4fc3-a7d8-6111e9147c25
(mirror: https://i.imgur.com/YTkWL7n.mp4)

Version

  • Server & Client v1.5.9-release-21135
  • Windows 11 (if relevant)

Additional context
Somewhat off-topic, but I think neither of the zoom controls should return true if we use the scroll wheel when we're not aiming. Like when switching weapons, etc.
Edit: probably related to issue #2275

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions