diff --git a/client/main.lua b/client/main.lua index 17a3db65..39bdf327 100644 --- a/client/main.lua +++ b/client/main.lua @@ -438,6 +438,7 @@ Citizen.CreateThread(function() if loadoutChanged and isLoadoutLoaded then ESX.PlayerData.loadout = loadout + TriggerServerEvent('esx:updateLoadout', loadout) end end end) diff --git a/server/main.lua b/server/main.lua index 16047c86..329fc379 100644 --- a/server/main.lua +++ b/server/main.lua @@ -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