Skip to content

Installation

1. Dependencies

Make sure these are installed and started before Auto Drive:

  • Your framework: qb-core, qbx_core or es_extended
  • ox_lib
  • oxmysql
  • vns-core - free and open source, downloaded separately from your Keymaster/cfx Portal (it is not inside the script zip and updates on its own)

vns-core detects your framework and checks vehicle ownership against the framework's own vehicle table (player_vehicles on QBCore/QBox, owned_vehicles on ESX). Auto Drive has no framework or database settings of its own.

2. Resource

Copy the vns-autodrive folder into your resources and start it after vns-core:

ensure qb-core        # or qbx_core / es_extended
ensure ox_lib
ensure oxmysql
ensure vns-core
ensure vns-autodrive

Ensure order

  • vns-core must be ensured after ox_lib, oxmysql (database), your framework, inventory, target system and your other server scripts such as housing, garages and phone.
  • vns-autodrive must be ensured after vns-core.

If vns-core starts too early, VNS scripts can't use your database, items, money or other systems. See Installing vns-core.

3. Commands and keybind

Both commands are available to every player:

Command What it does
/autodrive [speed] Toggles the autopilot to the current map waypoint. Speed is slow, normal, fast or superfast. Without an argument the usage text is shown.
/markvehicle In the driver seat of an allowed vehicle: marks it (a blip is added) for the summon feature. On foot or in any other vehicle: unmarks it.

With Config.Keybinds.enable = true a key mapping is registered - F7 by default. Players can rebind it under Settings → Key Bindings → FiveM. The keybind always uses the mode set in Config.Keybinds.speed.

4. First start

  1. Restart the server and get into a vehicle you own that is in Config.Vehicles (or set Config.Vehicles = {} to allow all).
  2. Set a waypoint and run /autodrive normal.
  3. You should see "Auto Drive activated!" and the vehicle starts driving. Touch the pedals or wheel to take over.

"This vehicle has no owner." means the plate isn't in your framework's vehicle table; "Only the owner can use Auto Drive mode." means it belongs to someone else (see Config.OwnerOnly).

Encrypted variant

config.lua, client/client_open.lua and server/server_open.lua stay editable in the Encrypted variant - everything on this page and the Configuration page can be changed in both variants.

Updating from the previous version

  • vns-core is now required, and the script now runs on QBox and ESX as well as QBCore. The QBCore = exports['qb-core']:GetCoreObject() line is gone.
  • No MySQL library setting. Config.oxmysql, Config.MysqlAsync and Config.GhmattiMysql are removed - ownership is checked through vns-core.
  • Renamed options:

    Old New
    Config.owned_vehicles Config.RequireOwner
    Config.owner_only Config.OwnerOnly
    Config.vehicles Config.Vehicles
    Config.Messages Config.Lang
    Config.Keybinds.text Config.Lang.keybindText
  • One speed table. The new Config.Speeds is used by both the command and the keybind. Previously the keybind's normal was about 184 km/h while the command's was about 76 km/h; now both use the same value.

  • Allowing all vehicles: use Config.Vehicles = {}. An empty table used to whitelist nothing.
  • New options: Config.MarkCommand (the /markvehicle name is now configurable) and new texts for the chat suggestions and usage message.
  • Notifications moved. showNotification is now in client/client_open.lua instead of config.lua.