altmp / altv-issues

Issues and roadmap for alt:V project
92 stars 17 forks source link

Opening client console while shooting will keep player shooting forever #2278

Closed edgarasx closed 1 month ago

edgarasx commented 1 month ago

Description of the problem

LMB/RMB buttons get stuck if player enters any altv menu while already pressing them. Then once a menu is opened they can release those buttons and the game does not seem to record that, so for example when client console is closed down the game continues to return true for a control press in the natives even though the player is no longer pressing anything.

Reproduction steps

1) Equip any weapon. 2) Press either LMB or RMB. 3) While pressing, open console with F8 or alt:V menu with F1 or disable alt.toggleGameControls in code. 4) Once the menu is opened you can release the button. The player continues to aim/shoot, even if you close the menu.

The issue is that if player closes the console they can continue to shoot without pressing anything and functions such as native.isControlPressed will continue to return true even if player is not pressing anything at all. I tried lots of natives to stop player from shooting, but nothing works. The issue only seems to occur with mouse buttons.

Expected behaviour

When alt:V menu/client console is opened or alt.toggleGameControls is used the player should stop using LMB/RMB.

Additional context

No response

Operating system

Windows

Version

16.0.155 (release)

Crashdump ID

No response

Confirmation of issue's presence

xxshady commented 1 month ago

duplicate of #808