I've mention this on the discord but I'll put it here as well. The need, optionally, is for interior detection. The point is to allow players to finish their robberies (shop, liquor store) and heists (bobcat, casino) before police are dispatched. For example, some shop robberies dispatch police immediately when the first register is broken open and players are unable to complete the rest of the robbery because AI Police are shooting them through the window. The other example are heists like Casino where players are so deep into a shell that the police have been evaded before they even leave the shell.
The idea is to detect when the player is inside interiors (i.e. inside a shop, or a shell like the casino heist) and only dispatch police when players exit the interior. This allows players to finish their robberies and exit the interiors before needing to evade police. This also solves the issue of evading police by entering interiors.
All of this can be achieved using state bags and player metadata. A thread containing a loop that monitors interior detection when players are wanted is all that is needed. When players are inside, suppress police presence, as soon as players leave the interior, dispatch the police. While inside interiors or if a player disconnects, their wanted status (stars) are safely stored in player metadata so upon existing interiors or returning online, the police can engage the player.
I can share a snippet I have for this if needed. TIA.