Skip to content

Commit

Permalink
Update v1.4.1
Browse files Browse the repository at this point in the history
* Bugfix
  • Loading branch information
Musiker15 committed Nov 17, 2023
1 parent 24a830a commit 5030e85
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4
1.4.1
2 changes: 1 addition & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ games { 'gta5' }
author 'Musiker15 - MSK Scripts'
name 'msk_weaponammoitems'
description 'Weapon Ammunition with Items'
version '1.4'
version '1.4.1'

lua54 'yes'

Expand Down
7 changes: 4 additions & 3 deletions server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ AddEventHandler('msk_weaponammoitem:addWeaponAmmo', function(weaponName, item, d
xPlayer.addInventoryItem(data.item, data.amount)

local hasAmmo = xPlayer.getInventoryItem(data.item)
if not hasAmmo or hasAmmo.count == 0 then return end
local ammoToAdd = data.amount
if hasAmmo and hasAmmo.count > 0 then ammoToAdd = ammoToAdd + hasAmmo.count end

xPlayer.updateWeaponAmmo(weaponName, hasAmmo.count + data.amount)
SetPedAmmo(GetPlayerPed(xPlayer.source), joaat(weaponName), hasAmmo.count + data.amount)
xPlayer.updateWeaponAmmo(weaponName, ammoToAdd)
SetPedAmmo(GetPlayerPed(xPlayer.source), joaat(weaponName), ammoToAdd)
end)

RegisterNetEvent('msk_weaponammoitem:updateWeaponAmmo')
Expand Down

0 comments on commit 5030e85

Please sign in to comment.