Installation
This guide walks through every step required to get Carplay V2 running on your server: dependencies, resource extraction, database, optional Discord bot setup, optional inventory item registration, and configuration.
Requirements
| Dependency | Required? | Notes |
|---|---|---|
oxmysql | Yes | Database driver — used by all SQL queries |
code9_sound | Yes | 3D positional audio engine for the music player + equalizer (ships with the bundle) |
code9_carplayProp | Yes (for DUI) | Streams the in-vehicle screen prop (mdigou_boombox_car_prop_02) used by the DUI screen feature. Not strictly required if Config.Screen.enabled = false and you don't use the in-world screen at all |
FiveM Server 5848+ | Yes | Minimum artifact version |
es_extended | Optional | ESX framework support (auto-detected) |
qb-core | Optional | QBCore framework support (auto-detected) |
qbx_core | Optional | QBox framework support (auto-detected) |
ox_lib | Optional | Used only when Config.NotificationSystem = "ox_lib" |
Steps
1. Extract Resource
Place the code9_carplayv2 folder into your server's resources/ directory. The folder name must remain code9_carplayv2 — it is referenced by the in-vehicle DUI screen URL.
2. Add to server.cfg
ensure oxmysql
ensure es_extended # or qb-core / qbx_core, depending on your framework
ensure code9_sound
ensure code9_carplayProp # only needed if you use the in-vehicle screen
ensure code9_carplayv2
3. Database
There is no manual SQL import required — the script creates all tables automatically on first server boot via oxmysql.query.await. The following tables are created:
| Table | Purpose |
|---|---|
code9_carplay2 | Per-player settings, liked songs, playlist, volume |
code9_carplay2_mileage | Internal mileage tracking (per plate) |
code9_carplay2_dashcam | Uploaded dashcam / security cam recordings |
If you prefer manual SQL import, the same schema is in the included data.sql file.
4. Open shared/config.lua
This is the main config file and contains every public option (everything except secrets). Set:
Config.Locale—"en","tr","es","de","fr","nl","pt"(or add your own — see Locale System)Config.IdentifierType—"license","steam","discord","license2"Config.NotificationSystem—"gta","ox_lib","esx","qb"Config.FuelSystem— your fuel resourceConfig.VehicleLockSystem— your key/lock resourceConfig.MileageSystem—"auto","internal","jg-vehiclemileage","cd_garage"Config.InventorySystem—"auto"or a specific provider
See General Settings for the full list.
5. Open server/config.lua (Secrets)
This is the server-only config file. It is escrow-ignored, so server owners can edit it. Add:
ServerConfig.YouTubeAPIKey = "YOUR_YOUTUBE_API_KEY" -- required for music search
YouTube API key is free — get one at console.cloud.google.com and enable YouTube Data API v3.
For optional features, set:
ServerConfig.DiscordBotToken+DiscordGuildId— for Discord role permissions (see step 7)ServerConfig.DashCamFivemanageApiKey— for dashcam recording uploadsServerConfig.DashCamDiscordWebhook— alternative upload method (25MB Discord limit)ServerConfig.SecurityCamFivemanageApiKey/SecurityCamDiscordWebhook— separate destinations for security cam (or leave empty to use dashcam settings)
See Server Config for the full list.
6. Choose How Players Open Carplay
In shared/config.lua, you have three opening methods:
Option A — Command (default)
Config.Command = "carplay"
Config.UseItem = false
Players type /carplay in chat while in the driver seat.
Option B — Keybind
Config.EnableKey = true
Config.DefaultKey = "F10"
Config.BindingDescription = "Open Carplay"
Config.UseItem = false
The keybind appears under Settings → Keybinds → FiveM in-game where players can rebind it.
Option C — Inventory Item
Config.UseItem = true
Config.ItemName = "carplay"
When item-based opening is enabled, the command and keybind are automatically disabled. You then need to register the item in your inventory:
For ox_inventory
Add to ox_inventory/data/items.lua:
['carplay'] = {
label = 'Carplay',
weight = 100,
server = {
export = 'code9_carplayv2.carplayItem'
},
},
For qs-inventory
The script automatically calls exports['qs-inventory']:CreateUsableItem('carplay', ...) on resource start. Just make sure the item exists in your qs-inventory items list.
For codem-inventory
Same as qs-inventory — automatically registered via exports['codem-inventory']:CreateUsableItem.
For ESX / QBCore / QBox
The script automatically calls ESX.RegisterUsableItem / QBCore.Functions.CreateUseableItem / QBX.Functions.CreateUseableItem on resource start. Just make sure the item exists in your items table or items config.
7. (Optional) Discord Role Permissions
If you want per-feature, per-app Discord role gating (in addition to job-based gating), set up a Discord bot:
- Go to discord.com/developers/applications → New Application
- Add a Bot to the application and copy the Bot Token
- Under Privileged Gateway Intents, enable Server Members Intent
- Invite the bot to your Discord server with the
botscope and at minimum View Server Members permission - Right-click your Discord server → Copy Server ID (enable Developer Mode if needed)
- In
server/config.lua:
ServerConfig.DiscordBotToken = "YOUR_BOT_TOKEN"
ServerConfig.DiscordGuildId = "YOUR_GUILD_ID"
ServerConfig.DiscordCacheDuration = 120 -- seconds
The script's built-in fetcher will pull each player's Discord roles via the Discord API and cache them. You can then reference role IDs in any discordRoles array throughout Config.
To get a role ID: in Discord with Developer Mode on, right-click any role → Copy Role ID.
8. (Optional) Camera Recording Uploads
If you want DashCam or Security Camera recordings uploaded to permanent storage:
Fivemanage (recommended for files >25MB)
- Sign up at fivemanage.com
- Create an API key with video upload permission
- In
server/config.lua:
ServerConfig.DashCamUploadProvider = "fivemanage"
ServerConfig.DashCamFivemanageApiKey = "YOUR_API_KEY"
Discord Webhook (25MB limit, ~1.5 min recording)
- In your Discord server, create a channel for recordings
- Channel settings → Integrations → Webhooks → New Webhook → copy the URL
- In
server/config.lua:
ServerConfig.DashCamUploadProvider = "discord"
ServerConfig.DashCamDiscordWebhook = "YOUR_WEBHOOK_URL"
9. (Optional) In-Vehicle Screen Prop
The DUI screen mounts a physical prop onto the vehicle dashboard which mirrors the tablet live. This is opt-in:
Config.Screen.enabled = true
Config.Screen.requiredToUse = false -- set true to require a screen item to use Carplay
Config.Screen.item = 'carplay_screen' -- inventory item name
The default prop is mdigou_boombox_car_prop_02 — change Config.Screen.propModel, textureDict and textureName to use your own.
See In-Vehicle Screen Settings for full details.
10. Restart Server
Restart your server (or just ensure code9_carplayv2). The first time you open Carplay, you will see the setup wizard — name, avatar, theme. After that you land on the home screen.
Verification Checklist
After installation, verify each of these works:
-
/carplayopens the tablet inside a vehicle - First-run wizard appears for new players
- All apps are accessible from the sidebar
- Music search works (YouTube API key set?)
- DashCam recording uploads to Fivemanage / Discord (if enabled)
- Discord roles show up correctly (if enabled — check F8 console for
[DISCORD]logs) - Locale strings match your
Config.Localesetting - Resource usage is
0.00–0.02 msidle (resmonin F8)
If any check fails, set Config.DebugPrint = true in shared/config.lua and restart — verbose logs will appear in the F8 console with [code9_carplay2] prefixes.
