Files
red-valley/resources/[framework]/[addons]/kq_carheist/client/editable/qb.lua
2026-03-29 21:41:17 +03:00

41 lines
1.1 KiB
Lua

if Config.qbSettings.enabled then
if Config.qbSettings.useNewQBExport then
QBCore = exports['qb-core']:GetCoreObject()
end
job = QBCore.Functions.GetPlayerData().job
gang = QBCore.Functions.GetPlayerData().gang
RegisterNetEvent('QBCore:Client:OnPlayerLoaded')
AddEventHandler('QBCore:Client:OnPlayerLoaded', function()
job = QBCore.Functions.GetPlayerData().job
gang = QBCore.Functions.GetPlayerData().gang
TriggerServerEvent('kq_carheist:playerLoaded')
end)
RegisterNetEvent('QBCore:Client:OnJobUpdate')
AddEventHandler('QBCore:Client:OnJobUpdate', function(JobInfo)
job = JobInfo
end)
RegisterNetEvent('QBCore:Client:OnGangUpdate')
AddEventHandler('QBCore:Client:OnGangUpdate', function(GangInfo)
gang = GangInfo
end)
function IsPolice()
if not job then
return false
end
return Contains(Config.policeJobNames, job.name)
end
function IsInGang()
if not gang then
return false
end
return gang.name ~= nil and gang.name ~= 'none' and gang.name ~= ''
end
end