mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-01 18:58:54 +00:00
feat(loadout): extract loadout loading to his own handler
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user