Firstly:

Citizen.CreateThread(operate()
    for i = 1, 32 do
        Citizen.InvokeNative(0xDC0F817884CDD856, i, false) -- EnableDispatchService
    finish
    whereas true do
        Citizen.Wait(0)
        if GetPlayerWantedLevel(PlayerId()) ~= 0 then
            ClearPlayerWantedLevel(PlayerId())
        finish
    finish
finish)

That is the supply code :smiley:

Secondly that is hella inefficient, use this native: SET_MAX_WANTED_LEVEL – Cfx.re Docs



Looking for paid scripts? Click here