Fixed yet again player data not loaded

This commit is contained in:
ElPumpo
2018-07-25 12:35:38 +02:00
parent a2f6061e3c
commit dec706afed
+20 -1
View File
@@ -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