Whenever setting the ammo of an NPC PED to the desired number, the PED’s ammo remains infinite, and GetAmmoInPedWeapon always returns -1. Is this a technological limitation of FiveM? Or is it something that the developers haven’t fixed yet? Or am I doing something very wrong in this logic?
local MurderNPCModel = GetHashKey("a_m_m_business_01")
RequestModel(MurderNPCModel)
while not HasModelLoaded(MurderNPCModel) do
Citizen.Wait(0)
end
local MurderNPC = CreatePed(4, MurderNPCModel, 0.0, 0.0, 0.0, 0.0, true, true)
if DoesEntityExist(MurderNPC) then TriggerServerEvent('custom:SetInitialNPCsBucketEqualSourcePlayerID', NetworkGetNetworkIdFromEntity(MurderNPC)) end
SetEntityCoords(MurderNPC, 1029.6010, 914.1136, 222.0574, false, false, false, false)
SetEntityHeading(MurderNPC, 331.6583)
GiveWeaponToPed(MurderNPC, GetHashKey("WEAPON_REVOLVER"))
SetCurrentPedWeapon(MurderNPC, GetHashKey("WEAPON_REVOLVER"), true)
SetPedAmmo(MurderNPC, GetCurrentPedWeapon(MurderNPC), 1)
print(GetAmmoInPedWeapon(MurderNPC, GetCurrentPedWeapon(MurderNPC)))
Sorry, yesterday I was very tired at night and I ended up not noticing lol, but even after adjusting this the NPC still has infinite ammo and continues to print 0 when trying to get how much ammo he has