Autopilot
GPS-guided autonomous driving system. Set a destination on the map, choose a drive mode and behavior flags, and the vehicle drives itself there using FiveM's TaskVehicleDriveToCoord native.
Speed Modes
Speeds are fully configurable via Config.AutoPilotSpeeds:
| Mode | Default Speed | Use Case |
|---|---|---|
| Eco | 80 km/h | Casual city driving |
| Sport | 120 km/h | Faster highway driving |
| Sport+ | 180 km/h | Maximum speed driving |
Config.AutoPilotSpeeds = {
eco = 80.0,
sport = 120.0,
["sport+"] = 180.0,
}
How It Works
- Open the Map app
- Pick a destination (search, favorites, recents, or tap on the map)
- Tap Autopilot
- Select a speed mode (Eco / Sport / Sport+)
- Toggle any of the 17 driving behavior flags
- Press Go
- The vehicle drives itself, with a live navigation HUD showing remaining distance and turn information
- Autopilot automatically disengages on arrival
You can also press Stop at any point to take back manual control.
Navigation HUD
While autopilot is engaged (or any waypoint is set), a navigation HUD widget can show on the dashboard:
- Remaining distance (with km / m units, localized)
- Current drive mode
- Quick stop button
Driving Behavior Flags
17 flags from the FiveM TaskVehicleDriveToCoord native are exposed in Config.AutoPilotSettings. Each is a row that the player can toggle on/off in the autopilot settings panel.
| Flag | Decimal value | Description | Default |
|---|---|---|---|
DF_STOP_FOR_CARS | 1 | Stops before vehicles | false |
DF_STOP_FOR_PEDS | 2 | Stops before pedestrians | false |
DF_SWERVE_AROUND_ALL_CARS | 4 | Avoids vehicles | false |
DF_STEER_AROUND_STATIONARY | 8 | Avoids parked / stopped vehicles | false |
DF_STEER_AROUND_PEDS | 16 | Avoids pedestrians | false |
DF_STEER_AROUND_OBJECTS | 32 | Avoids objects | false |
DF_DONT_STEER_AROUND_PLAYER | 64 | Will not avoid player ped | false |
DF_STOP_AT_LIGHTS | 128 | Stops at traffic lights | false |
DF_GO_OFF_ROAD_AVOIDING | 256 | Allow off-road when avoiding | false |
DF_ONCOMING_TRAFFIC | 512 | Drives wrong way if lane is full | false |
DF_DRIVE_IN_REVERSE | 1024 | Drives in reverse gear | false |
DF_WANDER_FALLBACK | 2048 | Cruise randomly if pathfinding fails | false |
DF_AVOID_RESTRICTED | 4096 | Avoid restricted areas | false |
DF_ADJUST_SPEED_ROAD | 16384 | Follow road speed limit | false |
DF_USE_SHORT_CUT | 262144 | Take shortest path, uses dirt roads | false |
DF_CHANGE_LANES | 524288 | Changes lanes around obstructions | false |
DF_AVOID_HIGHWAYS | 536870912 | Avoid highways unless necessary | false |
The script ORs all enabled flag values into a single bitmask before passing it to the native. To customize defaults, change the value = false field in each row of Config.AutoPilotSettings.
Permissions
Autopilot is gated by Config.AutoPilotPermissions:
Config.AutoPilotPermissions = {
jobs = {}, -- e.g. {"police", "ambulance"} — empty = everyone
discordRoles = {}, -- e.g. {"123456789012345678"} — empty = everyone
}
See Permission System for how the OR-logic works.
Module Toggle
| Option | Default | Description |
|---|---|---|
Config.Modules.AutoPilot | true | Show the autopilot module at all |
