Opening Method
Carplay V2 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 | "carplay" | 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 Carplay" | Description shown in keybind settings |
Config.UseItem | false | Use inventory item instead (disables command + key) |
Config.ItemName | "carplay" | Item name in inventory |
Config.InventorySystem | "auto" | Override auto-detection. Options: "auto", "ox", "qs", "codem", "esx", "qb", "qbox" |
Method 1 — Chat Command
The default. Players type /carplay in chat while in the driver seat.
Config.Command = "carplay"
Config.UseItem = false
Method 2 — Keybind
Add a keybind so players can rebind to whatever key they prefer:
Config.Command = "carplay" -- still works as a fallback
Config.EnableKey = true
Config.DefaultKey = "F10"
Config.BindingDescription = "Open Carplay" -- 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 Carplay to be a physical item (often paired with Config.Screen.requiredToUse = true):
Config.UseItem = true
Config.ItemName = "carplay"
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:
['carplay'] = {
label = 'Carplay',
weight = 100,
server = {
export = 'code9_carplayv2.carplayItem'
},
},
The export code9_carplayv2.carplayItem is defined in server/open.lua and triggers c9:carplay2: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.
