Disabling Engines at Stations

How would I get rid of these Engines spawning at the stations around LS? I’ve tried disabling the WORLD_VEHICLE_FIRE_TRUCK scenario type and even doing this:

local z1, z2 = vec3(-10000.0, -10000.0, -1000.0), vec3(10000.0, 10000.0, 1000.0)
if not DoesScenarioBlockingAreaExist(z1, z2) then
	AddScenarioBlockingArea(z1, z2, 0, 1, 1, 1)
end

and it still doesn’t work. I also added a Dispatch Blocking Area but still no results. Are there any scripts that have already done this or does anyone have other methods?

example image:

2 Likes

Scenarios would be controlling the trucks you see out on the street responding to calls etc.

Vehicle spawns come from Generators (which are included in the map).

You could remove them by editing the map with a tool like OpenIV but may be able to stop them from spawning using natives like:

https://runtime.fivem.net/doc/natives/#_0x46A1E1A299EC4BBA

The last param is almost always zero, in SP scripts. In a few cases it’s 1 so you may need to experiment with both.

Example Usage:
VEHICLE::SET_ALL_VEHICLE_GENERATORS_ACTIVE_IN_AREA(2714.245f, 4149.125f, 41.66869f, 2727.446f, 4134.204f, 47.1282f, false, 0);

  VEHICLE::REMOVE_VEHICLES_FROM_GENERATORS_IN_AREA(2714.245f, 4149.125f, 41.66869f, 2727.446f, 4134.204f, 47.1282f, 0);

    if (!PED::_DOES_SCENARIO_BLOCKING_AREA_EXIST(2715.88f, 4151.569f, 41.42824f, 2731.836f, 4133.244f, 46.15367f))

    {

        iParam0->f_68 = PED::ADD_SCENARIO_BLOCKING_AREA(2715.88f, 4151.569f, 41.42824f, 2731.836f, 4133.244f, 46.15367f, 0, 1, 1, 1);

    }
1 Like

Thank you so much, it seems like it worked.

I used the SetAllVehicleGeneratorsActiveInArea native along with disabling the scenarios in the area and the firetrucks along with the firefighters have stopped spawning.

I knew there was a native like this but I couldn’t find it, thanks for the help :slight_smile:

Would you mind telling us how you prevent peds from spawning ?

Adding a scenario blocking area around the station worked for me

1 Like