[FREE] [QBCore] AI Police

No worries happy to share, and most likely could be optimized. No checks if in vehicle or anything.
Only tested few times but surrender option so far:

RegisterCommand('surrender', function()
    QBCore.Functions.TriggerCallback("phade-aipolice:server:GetCops", function(copCount) 
        if copCount == 0 then 
			FreezeEntityPosition(PlayerPedId(), true)
            TriggerEvent('animations:client:EmoteCommandStart', {"surrender"})
            SetPoliceIgnorePlayer(PlayerId(), true)
            ClearPlayerWantedLevel(PlayerId())
            SetPlayerWantedLevelNow(PlayerId(),false)
            Citizen.Wait(2500)
            TriggerEvent("police:client:SendToJailAI", (PlayerId()), 30)
            FreezeEntityPosition(PlayerPedId(), false)
        end                        
    end)
end)

Did try with Progressbar and other options but had issue if people cancel they can abuse it to reset their wanted level, didn’t find way to avoid that yet or find other Natives stop police shooting. Could of course counter that with setting wanted level on random number or something.

Might be nice to do something with hands up function to surrender.