Need to make a No Spawn zone for peds

Hello !
My goal is simple : I need to stop peds from spawning on the south of the map (under fort zancudo, sandy shores etc).
I want all peds to live normally on the north, but no pedestrians and driving cars in the south.
I tried with SET_PED_NON_CREATION_AREA, CLEAR_AREA_OF_PEDS, tried to modify the “IHateAI” script, but nothing seems to work… Either it does nothing, or no peds are spawning on the entire map…

There is probably a better way to do this but you could use GetNameOfZone at the players coords and then a configuration table that has the zone key and density value for whether peds and vehicles should spawn there.

Run a thread that loops per frame and constantly sets the density multipliers according to how you’ve set them up in your configuration table.





https://runtime.fivem.net/doc/natives/?_0xEAE6DCC7EEE3DB1D
https://runtime.fivem.net/doc/natives/?_0xB3B3359379FE77D3
1 Like