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
  • Games
  • Radical Entertainment
  • The Simpsons: Hit & Run
  • Scripting
  • Console Commands
  • CON Commands

SetDriver

This command sets the driver of a vehicle.

Scope

This command should be called within a vehicle's .con file.

Syntax

MFK
Lua
SetDriver( character );
Game.SetDriver( character )
  • character: The name of the character who will drive the vehicle.
    • This character will only appear if they're not suppressed with SuppressDriver in the level's load script.

Examples

MFK
Lua
// This vehicle will have Homer as its driver (unless he's suppressed for the level)
SetDriver("homer");
// "none" is special and means the vehicle will have no driver.
SetDriver("none");
-- This vehicle will have Homer as its driver (unless he's suppressed for the level)
Game.SetDriver("homer")
-- "none" is special and means the vehicle will have no driver.
Game.SetDriver("none")

Notes

Using "none" is NOT equivalent to not calling the command outright. Omitting the command entirely is special in two cases:

  • Traffic Vehicles: Traffic car CON files do not call this command at all. This indicates to the game that it should add an invisible driver that uses random traffic dialogue.
  • Mission Vehicles: Mission vehicles added with AddStageVehicle can define a path to their CON file. These CON files typically omit SetDriver as AddStageVehicle can specify a driver inline which does not work if the CON file does so.