Donut Team is a labor of love, built and maintained by a small group of passionate developers. We invest our own time and resources to offer our tools, mods, and web services completely free of charge.

We don't run ads, and we will never sell your data - period.

If you've enjoyed anything we've created, please consider supporting our work with a one-time or monthly donation via our Ko-fi page . Every contribution helps us continue building great experiences for the community.

Dismiss
  • Modding Tools
  • Lucas' Simpsons Hit & Run Mod Launcher
  • Hacks
  • Mod Requirable Hacks
  • Additional Script Functionality
  • Console Commands
  • MFK Commands
  • Mission Initialisation

SetPedsEnabled

Available since Version 1.20.

Sets whether or not pedestrians are enabled for a mission.

Scope

This command should be called between calls to SelectMission and CloseMission in a mission's initialisation script.

Syntax

MFK
Lua
SetPedsEnabled( peds_enabled );
Game.SetPedsEnabled( peds_enabled )
  • peds_enabled: Whether or not peds are enabled.

Examples

MFK
Lua
SelectMission("m1");
	// ...

    StreetRacePropsLoad("l4_m1p.p3d;");
	StreetRacePropsUnload("l4_m1p.p3d:");
    
    // Enable Peds even though Street Race Props are in use.
	SetPedsEnabled(1);

	AddStage();
    	// ...
	CloseStage();
CloseMission();
Game.SelectMission("m1")
	-- ...

    Game.StreetRacePropsLoad("l4_m1p.p3d;")
	Game.StreetRacePropsUnload("l4_m1p.p3d:")
    
    -- Enable Peds even though Street Race Props are in use.
	Game.SetPedsEnabled(1)

	Game.AddStage()
    	-- ...
	Game.CloseStage()
Game.CloseMission()

Notes

This command can be helpful for enabling peds in a mission where the "Street Race Props" would not interfere with the ped paths, such as the original game's L1M7 which lacks peds by default.

Version History

Version 1.23.8

Fixed a bug where calling SetPedsEnabled alongside StreetRacePropsLoad would cause pedestrians to become disabled after the mission ends until another mission puts it back.

Version 1.21

Removed the "!m_bStart" assert (previously on line 3292) related to using SetPedsEnabled.