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

Client crash on GetWeaponDataByWeaponHash #25

Open
TuK4z opened this issue Aug 10, 2024 · 2 comments
Open

Client crash on GetWeaponDataByWeaponHash #25

TuK4z opened this issue Aug 10, 2024 · 2 comments

Comments

@TuK4z
Copy link
Contributor

TuK4z commented Aug 10, 2024

When enter Hydra or Tank client event "WeaponChange" returns newweapon as 0 leading to crash when use Alt.GetWeaponDataByWeaponHash(newweapon)

@Doxoh
Copy link
Collaborator

Doxoh commented Sep 15, 2024

please provide full repo code

@TuK4z
Copy link
Contributor Author

TuK4z commented Sep 15, 2024

Sorry.

Clientside:
Alt.OnPlayerWeaponChange += (oldweapon, newweapon) => { AltV.Net.Client.Elements.Data.WeaponData? wData = Alt.GetWeaponDataByWeaponHash(newweapon); };

When entering hydra for example after one of the latest release updates ir started to return 0. I added check
if (newweapon == 0) return;

It's not a big problem but reporting, because it crash if you use GetWeaponDataByWeaponHash(0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants