Installation
1. Dependencies
Make sure these are installed and started before Auto Drive:
- Your framework:
qb-core,qbx_coreores_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-coremust be ensured after ox_lib, oxmysql (database), your framework, inventory, target system and your other server scripts such as housing, garages and phone.vns-autodrivemust be ensured aftervns-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
- Restart the server and get into a vehicle you own that is in
Config.Vehicles(or setConfig.Vehicles = {}to allow all). - Set a waypoint and run
/autodrive normal. - 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.MysqlAsyncandConfig.GhmattiMysqlare removed - ownership is checked through vns-core. -
Renamed options:
Old New Config.owned_vehiclesConfig.RequireOwnerConfig.owner_onlyConfig.OwnerOnlyConfig.vehiclesConfig.VehiclesConfig.MessagesConfig.LangConfig.Keybinds.textConfig.Lang.keybindText -
One speed table. The new
Config.Speedsis used by both the command and the keybind. Previously the keybind'snormalwas 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/markvehiclename is now configurable) and new texts for the chat suggestions and usage message. - Notifications moved.
showNotificationis now inclient/client_open.luainstead ofconfig.lua.