diff --git a/client/main.lua b/client/main.lua index cec70363..245c8976 100644 --- a/client/main.lua +++ b/client/main.lua @@ -170,6 +170,7 @@ AddEventHandler('esx:addWeapon', function(weaponName, ammo) local weaponHash = GetHashKey(weaponName) GiveWeaponToPed(playerPed, weaponHash, ammo, false, false) + SetPedAmmo(playerPed, weaponHash, ammo) -- remove leftover ammo end) RegisterNetEvent('esx:removeWeapon') @@ -178,6 +179,7 @@ AddEventHandler('esx:removeWeapon', function(weaponName) local weaponHash = GetHashKey(weaponName) RemoveWeaponFromPed(playerPed, weaponHash) + SetPedAmmo(playerPed, weaponHash, 0) -- remove leftover ammo end) -- Commands @@ -337,7 +339,6 @@ AddEventHandler('esx:pickupWeapon', function(weaponPickup, weaponName,ammo) local ped = GetPlayerPed(-1) local playerPedPos = GetEntityCoords(ped, true) - print(ammo) CreateAmbientPickup(GetHashKey(weaponPickup), playerPedPos.x + 2.0, playerPedPos.y, playerPedPos.z + 0.5, 0, ammo, 1, false, true) end)