RegisterServerEvent('esx_skin:save')
AddEventHandler('esx_skin:save', function(skin)
local xPlayer = ESX.GetPlayerFromId(source)
local defaultMaxWeight = ESX.GetConfig().MaxWeight
local backpackModifier = Config.BackpackWeight[skin.bags_1]
if backpackModifier then
xPlayer.setMaxWeight(defaultMaxWeight + backpackModifier)
Triggerevent('Fivemturk:setCurrentWeight',defaultMaxWeight + backpackModifier)
else
xPlayer.setMaxWeight(defaultMaxWeight)
end
MySQL.Async.execute('UPDATE users SET skin = @skin WHERE identifier = @identifier', {
['@skin'] = json.encode(skin),
['@identifier'] = xPlayer.identifier
})
end)