Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion/issue] Check for scoped weapons in hide hud components #119

Open
alberttheprince opened this issue Aug 9, 2024 · 1 comment
Labels
bug Something isn't working need repro This bug report needs confirmation

Comments

@alberttheprince
Copy link
Contributor

Summary

hidehudcomponents doesn't consider that some weapons have scope reticules

Reproduction

This is an issue with how hidehudcomponents is coded.

for i = 1, #disableHudComponents do

For example, in this fix that went stale in qb-smallresources:

https://github.com/qbcore-framework/qb-smallresources/pull/326/files#diff-e7bc7e42f01f31f2c93fcc43ba761b7a547f8cee620a4d596c2fdb5dc175feff

Detection is done by doing:

-- Check for sniper rifle local currentWeapon = GetSelectedPedWeapon(PlayerPedId()) if currentWeapon == GetHashKey("WEAPON_SNIPERRIFLE") or currentWeapon == GetHashKey("WEAPON_MARKSMANRIFLE") or currentWeapon == GetHashKey("WEAPON_MARKSMANRIFLE_MK2") or currentWeapon == GetHashKey("WEAPON_HEAVYSNIPER") then ShowHudComponentThisFrame(14) else HideHudComponentThisFrame(14) end

This works, but there's likely a more elegant solution that could go in a config or something, to account for custom weapons, future additions by rockstar.

Expected behavior

Snipers/scoped weapons display their reticle, even when reticles are disabled

Actual behavior

Hides sniper reticle

Additional context

While many people disable the crosshair for many reasons (RP, replacing it with their own server's crosshair, etc) this creates a problem for scoped weapons, as the overlay is actually the same type of reticle used in third person, just a different style.

Current Version

N/A

Custom Resources

N/A

@alberttheprince alberttheprince added bug Something isn't working need repro This bug report needs confirmation labels Aug 9, 2024
@qbox-duck qbox-duck bot added this to Issues Aug 9, 2024
@github-project-automation github-project-automation bot moved this to Todo in Issues Aug 9, 2024
@alberttheprince
Copy link
Contributor Author

alberttheprince commented Aug 9, 2024

Additionally a check for IsFirstPersonAimCamActive() to hide the 14 component should be done to hide the base game reticle when not aiming into a scope.

This is how it should look/function:

sniper.fixed.-.Made.with.Clipchamp.mp4

This is done using the above fix with the addition of IsFirstPersonAimCamActive() that went stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need repro This bug report needs confirmation
Projects
Status: Todo
Development

No branches or pull requests

1 participant