Temp code revert for loadout updating, fixes ammo sync

This commit is contained in:
ElPumpo
2020-02-11 11:37:47 +01:00
parent 6ed2e1c4e7
commit e25f5dee2e
2 changed files with 7 additions and 0 deletions
+1
View File
@@ -438,6 +438,7 @@ Citizen.CreateThread(function()
if loadoutChanged and isLoadoutLoaded then
ESX.PlayerData.loadout = loadout
TriggerServerEvent('esx:updateLoadout', loadout)
end
end
end)
+6
View File
@@ -236,6 +236,12 @@ AddEventHandler('esx:updateCoords', function(coords)
end
end)
RegisterNetEvent('esx:updateLoadout')
AddEventHandler('esx:updateLoadout', function(loadout)
local xPlayer = ESX.GetPlayerFromId(source)
xPlayer.loadout = loadout
end)
RegisterNetEvent('esx:giveInventoryItem')
AddEventHandler('esx:giveInventoryItem', function(target, type, itemName, itemCount)
local playerId = source