would be cool if you can release your changes… i am interested to implant this also in my policejob…
I recently started dorking with this. I couldnt get it to work until I modified this:
\resources[esx]\es_extended\client\main.lua
– disable wanted level
ClearPlayerWantedLevel(PlayerId())
SetMaxWantedLevel(5)
Had to set max wanted level.
I’m getting the same error on my server. Can you please post your changes that got it to work?
hey do you have a discord also can you put NPC cops in my server i can’t find anyone for the job and really would like to my my game like story mode
It’s been a long time but if somebody needs this to fix in 2025 here ist the change in the “Disable Wanted Level” part on the client script (Only the ESX before PlayerData is missing):
-- Disable wanted level
firstLoop = 'yes'
Citizen.CreateThread(function()
while true do
if firstLoop then
Citizen.Wait(10000)
else
Citizen.Wait(0)
end
if copCount >= 1 or ESX.PlayerData.job.name == 'police' then
local playerId = PlayerId()
if GetPlayerWantedLevel(playerId) ~= 0 then
SetPlayerWantedLevel(playerId, 0, false)
SetPlayerWantedLevelNow(playerId, false)
end
end
firstLoop = nil
end
end)
IMPORTANT Note: Only works when esx_society is turned off in the policejob config. Didn’t find out to this point how to use it with the wanted level.
bro using yes as a string instead of a boolean
FGS CHANGE ‘yes’ TO true