Sync consumed ammo with server properly

No more security issues here!
This commit is contained in:
ElPumpo
2020-03-22 09:43:43 +01:00
parent ff9930068f
commit 9a1dfa42ca
4 changed files with 48 additions and 56 deletions
+6 -3
View File
@@ -225,10 +225,13 @@ AddEventHandler('esx:updateCoords', function(coords)
end
end)
RegisterNetEvent('esx:updateLoadout')
AddEventHandler('esx:updateLoadout', function(loadout)
RegisterNetEvent('esx:updateWeaponAmmo')
AddEventHandler('esx:updateWeaponAmmo', function(weaponName, ammoCount)
local xPlayer = ESX.GetPlayerFromId(source)
xPlayer.loadout = loadout
if xPlayer then
xPlayer.updateWeaponAmmo(weaponName, ammoCount)
end
end)
RegisterNetEvent('esx:giveInventoryItem')