altmp / altv-issues

Issues and roadmap for alt:V project
93 stars 16 forks source link

Weapon Ammo type #2308

Open kernkode opened 3 months ago

kernkode commented 3 months ago

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

Lekenthu commented 3 months ago

I will confirm.