Skip to main content

Installation

Step-by-step installation guide for Code9 CarPlay

This section

Installation

Requirements

DependencyRequired?Notes
oxmysql / mysql-async / ghmattimysqlYes (one)Database driver for persistent data
ox_libYesRequired for command registration and callbacks
xsoundYesRequired for music playback with 3D audio
FiveM Server 5848+YesMinimum artifact version
es_extended / qb-coreOptionalFramework — configurable, standalone works

Steps

1. Extract Resource

Extract the code9_carPlay folder into your server's resources/ directory.

2. Add to server.cfg

ensure oxmysql
ensure ox_lib
ensure xsound
ensure code9_carPlay

3. Database Setup

Import the SQL file:

data.sql

This creates the code9_carplay table for persistent player data (playlists, liked songs, theme, volume, etc.).

4. YouTube API Key

Set your YouTube Data API v3 key in shared/config.lua:

lua
Config.YoutubeAPIKey = "YOUR_API_KEY_HERE"

This is required for fetching YouTube video titles in the music player.

5. Item Setup (Optional)

If you want to open CarPlay via an inventory item instead of a command:

  1. Set Config.UseItem = true in shared/config.lua
  2. Add the item to your inventory system
  3. For ox_inventory, add to ox_inventory/data/items.lua:
lua
['carplay'] = {
label = 'CarPlay',
weight = 100,
server = {
export = 'code9_carPlay.carplayItem'
},
},

6. Configure

Edit shared/config.lua to set your framework, fuel system, lock system, vehicle restrictions, autopilot settings, and themes.

7. Start Server

Restart your server. Open CarPlay with /carplay (default) or the configured key/item while in the driver seat.