feat(loadout): extract loadout loading to his own handler

This commit is contained in:
Romain Lanz
2017-09-13 22:04:39 +02:00
committed by GitHub
parent 287b9821d8
commit bf80c92a4a
@@ -89,13 +89,14 @@ AddEventHandler('skinchanger:loadDefaultModel', function()
end)
AddEventHandler('skinchanger:modelLoaded', function()
while not ESX.PlayerLoaded do
Citizen.Wait(0)
end
-- Restore loadout
TriggerEvent('esx:restoreLoadout')
end)
AddEventHandler('esx:restoreLoadout', function ()
local playerPed = GetPlayerPed(-1)
for i=1, #ESX.PlayerData.loadout, 1 do
@@ -104,7 +105,6 @@ AddEventHandler('skinchanger:modelLoaded', function()
end
LoadoutLoaded = true
end)
RegisterNetEvent('esx:setAccountMoney')
@@ -582,4 +582,4 @@ Citizen.CreateThread(function()
end
end
end)
end)