mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 18:01:36 +00:00
Fixed yet again player data not loaded
This commit is contained in:
+20
-1
@@ -29,7 +29,7 @@ Citizen.CreateThread(function ()
|
||||
Citizen.Wait(0)
|
||||
end
|
||||
|
||||
Citizen.Wait(5000)
|
||||
Citizen.Wait(10000)
|
||||
|
||||
ESX.TriggerServerCallback('esx_vehicleshop:getCategories', function (categories)
|
||||
Categories = categories
|
||||
@@ -54,6 +54,25 @@ Citizen.CreateThread(function ()
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx:playerLoaded')
|
||||
AddEventHandler('esx:playerLoaded', function(xPlayer)
|
||||
ESX.PlayerData = xPlayer
|
||||
|
||||
if Config.EnablePlayerManagement then
|
||||
if ESX.PlayerData.job.name == 'cardealer' then
|
||||
Config.Zones.ShopEntering.Type = 1
|
||||
|
||||
if ESX.PlayerData.job.grade_name == 'boss' then
|
||||
Config.Zones.BossActions.Type = 1
|
||||
end
|
||||
|
||||
else
|
||||
Config.Zones.ShopEntering.Type = -1
|
||||
Config.Zones.BossActions.Type = -1
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx_vehicleshop:sendCategories')
|
||||
AddEventHandler('esx_vehicleshop:sendCategories', function (categories)
|
||||
Categories = categories
|
||||
|
||||
Reference in New Issue
Block a user