altv-issues icon indicating copy to clipboard operation
altv-issues copied to clipboard

`setWeaponAmmo` does not work with custom weapons from resources

Open S0P4 opened this issue 1 year ago • 7 comments

Description of the problem

setWeaponAmmo when is used for weapons resources will not set any ammo.

Desired solution for the problem

When a weapon resource is loaded, slould parse the data.

Alternatives you considered

No response

Additional context

No response

Version

dev/15.0-dev615

S0P4 avatar Sep 12 '23 01:09 S0P4

I want to add its even more like a bug, because player.giveWeapon doesnt give addon weapon, but maybe it only happens with throwable weapon addon

xxshady avatar Sep 27 '23 13:09 xxshady

@xxshady it can be throwables, i try whit a shotgun and it work, but i cant give ammo.

S0P4 avatar Sep 27 '23 14:09 S0P4

shotgun is not throwable

xxshady avatar Sep 27 '23 14:09 xxshady

Have the same problem you can give yourself the weapon but cannot set any ammo

DeRo1337 avatar Oct 21 '23 11:10 DeRo1337

Its releted to how wepons work in v15 if u know the ammo hash for the weapon, u can use the ammo hash for setting up the ammo using player.setAmmo

S0P4 avatar Oct 21 '23 12:10 S0P4

marked as bug because player.giveWeapon was working for addons before v15

xxshady avatar Dec 18 '23 14:12 xxshady

Any updates on this? I didn't test it in the lastest release.

S0P4 avatar May 22 '24 22:05 S0P4

Tested on the lastest realease an seam to be working properly now.

S0P4 avatar Aug 24 '24 15:08 S0P4