mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-30 17:58:54 +00:00
Check if user has payed when exiting marker
This commit is contained in:
+17
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user