diff --git a/client/main.lua b/client/main.lua index 7bf9e794..cc5e2af4 100644 --- a/client/main.lua +++ b/client/main.lua @@ -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