altv-issues
altv-issues copied to clipboard
Weapon Ammo type
Description of the problem
I am trying to add explosive ammunition to my weapon, but in the attempt only the component is placed, and when I try to add the ammunition nothing happens, it has the explosive bullets component but with the functions of adding the ammunition it does nothing
Reproduction steps
alt.on('playerConnect', (player: alt.Player) => {
player.giveWeapon(alt.hash("weapon_CARBINERIFLE_MK2".toLowerCase()), 200, true);
player.addWeaponComponent(alt.hash("weapon_" + "CARBINERIFLE_MK2".toLowerCase()), 0x3D25C2A7);
let ammo = alt.getAmmoHashForWeaponHash(alt.hash("weapon_" + "CARBINERIFLE_MK2".toLowerCase()));
player.setAmmoFlags(alt.getAmmoHashForWeaponHash(alt.hash("weapon_" + "CARBINERIFLE_MK2".toLowerCase())), false, false, false, false);
player.setAmmo(ammo, 100);
player.setAmmo(0x3D25C2A7, 100);
});
Expected behaviour
I was waiting for him to give me the explosive bullets
Additional context
I don't know if it's a bug or I'm doing something wrong, I looked to see if anyone had tried to do this but I couldn't find anything.
Operating system
windows 10
Version
alt:V Server 16.1.1 (release)
Crashdump ID
none
Confirmation of issue's presence
- [X] By submitting this ticket, I affirm that I have verified the presence of this issue on the latest developer version available at the time of writing this ticket.