mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 17:28:53 +00:00
Sync consumed ammo with server properly
No more security issues here!
This commit is contained in:
+6
-3
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user