Log in to reply
 

How to drop ammo from a weapon?



  • How to drop ammo from a weapon? This code does not work, and I do not know why.

    Hash weap = GTA.Native.Function.Call<Hash>(GTA.Native.Hash.GET_SELECTED_PED_WEAPON, Game.Player.Character);
    Hash ammo = GTA.Native.Function.Call<Hash>(GTA.Native.Hash.GET_PED_AMMO_TYPE_FROM_WEAPON, Game.Player.Character, weap);
    GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_AMMO_TO_DROP, Game.Player.Character, ammo, 100);

    The documentation says that SET_PED_AMMO_TO_DROP takes ammoType and number of ammo. I get the ammoType hash with the native function GET_PED_AMMO_TYPE_FROM_WEAPON.


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.