Installation
Requirements
| Dependency | Required? | Notes |
|---|---|---|
oxmysql / mysql-async / ghmattimysql | Yes (one) | Database driver for persistent data |
ox_lib | Yes | Required for command registration and callbacks |
xsound | Yes | Required for music playback with 3D audio |
FiveM Server 5848+ | Yes | Minimum artifact version |
es_extended / qb-core | Optional | Framework — 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:
- Set
Config.UseItem = trueinshared/config.lua - Add the item to your inventory system
- 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.
