Closed Cupidojex closed 1 year ago
make sure your core is up to date and includes thne client side vehicle entering event handlers.
i have qbcore cersion 1.1.0
qbcore do not version control their code, so that doesnt mean anything
Make sure you have this code: https://github.com/qbcore-framework/qb-core/blob/main/client/events.lua#LL162-L181
If you dont, copy it into your core.
When the police or the drivers that the vehicles are not theirs take a radar, they get a blank screen when they go through a radar and they notify the police, even if it is the same agent that passes by, it can be fixed somehow ?
When the police or the drivers that the vehicles are not theirs take a radar, they get a blank screen when they go through a radar and they notify the police, even if it is the same agent that passes by, it can be fixed somehow ?
Yes, this is easily fixed by setting the option config.OnlyBillifOwned = true
https://github.com/tom-osborne/qb-speedcameras/blob/main/config.lua#L10
The players might still see the flash, but they will not be fined.
That's how it is set, but it's not normal for even the police to see it. is what I'm telling you
Make sure the correct job is listed in the ignored jobs
yea, police.
Have you done any troubleshooting at all?
playerJob
: https://github.com/tom-osborne/qb-speedcameras/blob/main/client/main.lua#LL41C12-L41C29i put a print in the function. u see?
---Checks whether the player's job is in the Config.ignoredJobs table.
---@return boolean
local function isJobExempt()
local playerJob = PlayerData.job
print(playerJob.name, playerJob.onduty)
if not playerJob then return false end
for _, job in pairs(Config.ignoredJobs) do
if playerJob.name == job and playerJob.onduty then return true end
end
return false
end
Add the line as shown above. This should print into your client console police true
Then, also add this print into the main loop:
---Main loop to check player speed when in vehicle and detect when caught speeding
local function monitorSpeed()
CreateThread(function()
monitoringSpeed = true
local sleep
print("isJobExempt()", isJobExempt())
if isJobExempt() then return end
This should also print true if you have a job that should be ignored.
print false but the police is onduty and have the job police... why?
I suspect it might not be getting your duty status correctly. If you go on/off duty does it fix it?
no, if yu go on/off print false
What about when you do command /duty
?
Try replacing the function like this:
---Checks whether the player's job is in the Config.ignoredJobs table.
---@return boolean
local function isJobExempt()
local Player = QBCore.Functions.GetPlayerData()
local playerJob = Player.job
if not playerJob then return false end
for _, job in pairs(Config.ignoredJobs) do
if playerJob.name == job and playerJob.onduty then return true end
end
return false
end
see nothing