diff --git a/client/main.lua b/client/main.lua index 8023038c..945f24d2 100644 --- a/client/main.lua +++ b/client/main.lua @@ -18,6 +18,7 @@ local LastZone = nil local CurrentAction = nil local CurrentActionMsg = '' local CurrentActionData = {} +local HasPayed = false Citizen.CreateThread(function() @@ -30,6 +31,8 @@ end) function OpenShopMenu() + HasPayed = false + TriggerEvent('esx_skin:openRestrictedMenu', function(data, menu) menu.close() @@ -60,6 +63,8 @@ function OpenShopMenu() TriggerServerEvent('esx_clotheshop:pay') + HasPayed = true + ESX.TriggerServerCallback('esx_clotheshop:checkPropertyDataStore', function(foundStore) if foundStore then @@ -145,8 +150,8 @@ function OpenShopMenu() 'pants_2', 'shoes_1', 'shoes_2', - 'chain_1', - 'chain_2', + 'chain_1', + 'chain_2', 'helmet_1', 'helmet_2', 'glasses_1', @@ -162,8 +167,18 @@ AddEventHandler('esx_clotheshop:hasEnteredMarker', function(zone) end) AddEventHandler('esx_clotheshop:hasExitedMarker', function(zone) + ESX.UI.Menu.CloseAll() CurrentAction = nil + + if not HasPayed then + + TriggerEvent('esx_skin:getLastSkin', function(skin) + TriggerEvent('skinchanger:loadSkin', skin) + end) + + end + end) -- Create Blips