Opening Method
Auto supports three mutually exclusive opening methods: command, keybind, or inventory item. When UseItem = true, command and keybind are automatically disabled.
Options
| Option | Default | Description |
|---|---|---|
Config.Command | "auto" | Chat command (set false to disable) |
Config.EnableKey | false | Enable keybind alongside command |
Config.DefaultKey | "F10" | Default key (player can rebind in FiveM settings) |
Config.BindingDescription | "Open Auto" | Description shown in keybind settings |
Config.UseItem | false | Use inventory item instead (disables command + key) |
Config.ItemName | "auto" | Item name in inventory |
Config.LegacyCommand | "carplay" | Older command, still registered so existing servers keep working (false to disable) |
Config.LegacyItemName | "carplay" | Older item name, still accepted alongside ItemName (false to disable) |
Config.InventorySystem | "auto" | Override auto-detection. Options: "auto", "ox", "qs", "codem", "esx", "qb", "qbox" |
Method 1 — Chat Command
The default. Players type /auto in chat while in the driver seat.
Config.Command = "auto"
Config.UseItem = false
Method 2 — Keybind
Add a keybind so players can rebind to whatever key they prefer:
Config.Command = "auto" -- /carplay also stays registered
Config.EnableKey = true
Config.DefaultKey = "F10"
Config.BindingDescription = "Open Auto" -- shows up under FiveM keybind settings
Config.UseItem = false
Once started, FiveM registers the keybind. Players can rebind it under FiveM Settings → Keybinds → FiveM in the pause menu.
Method 3 — Inventory Item
For roleplay servers that want Auto to be a physical item (often paired with Config.Screen.requiredToUse = true):
Config.UseItem = true
Config.ItemName = "auto"
When UseItem = true:
- Command and keybind are automatically disabled
- Players need the item in their inventory to open the tablet
- The script auto-registers the usable item on resource start (one of
ox_inventoryexport,ESX.RegisterUsableItem,QBCore.Functions.CreateUseableItem, etc.)
Inventory Provider Auto-Detection
The script detects which inventory you're using in this priority:
Config.InventorySystemoverride (if not"auto")ox_inventoryif startedqs-inventoryif startedcodem-inventoryif started- Framework fallback (ESX/QBCore/QBox
getInventoryItemetc.)
Override only if auto-detection picks the wrong one or if you have multiple inventories installed for testing.
ox_inventory Item Registration
Add to ox_inventory/data/items.lua:
['auto'] = {
label = 'Auto',
weight = 100,
server = {
export = 'code9_auto.autoItem'
},
},
The export code9_auto.autoItem is defined in server/open.lua and triggers c9:auto:useItem on the player's client.
qs-inventory / codem-inventory
These auto-register via CreateUsableItem exports — just make sure your item exists in their items list.
ESX / QBCore / QBox
These auto-register via the framework's usable item API on resource start. Make sure the item exists in your items table or qb-core/shared/items.lua.
Mileage System Override (related)
The same auto/override pattern is used for mileage:
Config.MileageSystem = "auto" -- "auto", "internal", "jg-vehiclemileage", "cd_garage"
"auto"priority:jg-vehiclemileage>cd_garage>internal"internal"usescode9_carplay2_mileagetable (no external dependency)"jg-vehiclemileage"reads viaexports['jg-vehiclemileage']"cd_garage"reads viaexports['cd_garage']:GetVehicleMileage
See Database for the internal mileage tracking detail.
