Skip to content
This repository has been archived by the owner on Sep 22, 2024. It is now read-only.

Commit

Permalink
Update server.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
Musiker15 committed Aug 30, 2023
1 parent d35818e commit 9cf5967
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ AddEventHandler('msk_weaponammo:addWeaponClip', function(weaponName, clip)
if (v.ammo + ammo) <= Config.checkMaxAmmo[clip] then
xPlayer.triggerEvent('msk_weaponammo:runAnimation')
xPlayer.addWeaponAmmo(weaponName, ammo)
TriggerClientEvent('msk_weaponammo:updateAmmo', src, weaponName, ammo)
Config.Notification(src, Translation[Config.Locale]['used_clip']:format(hasItem.label))

if Config.Removeables[clip] then xPlayer.removeInventoryItem(clip, 1) end
Expand All @@ -30,12 +31,15 @@ AddEventHandler('msk_weaponammo:addWeaponClip', function(weaponName, clip)
else
Config.Notification(src, Translation[Config.Locale]['check_maxammo'])
end

break
end
end
else
logging('debug', ('Weapon: %s, Item: %s, Ammo: %s'):format(weaponName, clip, ammo))
xPlayer.triggerEvent('msk_weaponammo:runAnimation')
xPlayer.addWeaponAmmo(weaponName, ammo)
TriggerClientEvent('msk_weaponammo:updateAmmo', src, weaponName, ammo)
Config.Notification(src, Translation[Config.Locale]['used_clip']:format(hasItem.label))

if Config.Removeables[clip] then
Expand Down

0 comments on commit 9cf5967

Please sign in to comment.