NR_CarPlay
A fully-featured vehicle dashboard with a custom React UI featuring YouTube music playback, GPS navigation, backup camera with proximity sensors, vehicle controls, weather display, and Discord avatar integration.
Features
- YouTube music player - Play YouTube audio via xSound with play, pause, stop, queue, history, and volume controls
- GPS navigation - Real-time waypoint tracking with turn-by-turn directions, street names, and distance display
- Backup camera - Proximity sensor system with left, right, and rear detection zones and audible beeping warnings
- Vehicle controls - Manage doors, windows, seats, trunk, hood, engine, and radio from the dashboard
- Weather display - Live in-game weather with temperature, location name, and hourly forecast
- Discord avatar integration - Fetches player's Discord avatar via bot API with server-side caching
- Streamer mode - Disable audio playback while keeping the UI functional (
/streamer) - Configurable UI theme - Change the accent color and logo via config.lua
- Seat switching - Switch between vehicle seats from the dashboard with cooldown protection
- Song queue & history - Queue upcoming tracks and replay songs from history (up to 20 entries)
- Auto-close - Dashboard automatically closes when exiting the vehicle
- Cursor toggle - Press
Left Altto toggle cursor focus while dashboard is open
Dependencies
| Resource | Description | Required |
|---|---|---|
| ox_lib | UI library (notifications, callbacks) | Yes |
| xsound | YouTube audio playback | Yes |
Installation
Step 1: Download
Download NR_CarPlay from your Tebex purchase and extract it to your resources folder:
server/
└── resources/
└── [nightrider]/
└── NR_CarPlay/
Step 2: server.cfg
Add the resource to your server configuration. ox_lib and xsound must start before NR_CarPlay:
ensure ox_lib
ensure xsound
ensure NR_CarPlay
Step 3: Discord Setup (Optional)
To enable Discord avatar integration, edit Configs/sv_config.lua:
SVConfig = {}
SVConfig.Discord = {
BotToken = "YOUR_BOT_TOKEN_HERE",
GuildId = "YOUR_DISCORD_SERVER_ID"
}
Your Discord bot must have the Server Members Intent enabled and be a member of your Discord server.
Step 4: Configure
Edit Configs/config.lua to customize the dashboard (see Configuration section below).
Step 5: Restart
Restart your server to load the resource.
xsound must be started before NR_CarPlay in your server.cfg. Without xsound, music playback will not work.
How It Works
1. Opening the Dashboard
Enter any vehicle and press F5 (configurable keybind) or use /opendashboard to open the dashboard. The dashboard only opens when inside a vehicle.
2. Home Page
The home screen shows the current time, date, weather temperature, location name, your Discord avatar, and the music player. A header bar displays live weather and location data.
3. Music Player
Enter a YouTube URL (full, short, or just the video ID) and click Play. The script auto-detects and converts partial URLs. Features include:
- Play/Pause/Stop - Full playback control
- Volume slider - Adjust from 1-100%
- Queue system - Add songs to queue, play from queue, clear queue
- Song history - Last 20 songs with thumbnails and artist info
- Previous/Next track - Skip between history and queue
- Real-time progress - Shows current timestamp and total duration
- YouTube metadata - Fetches song title, artist, and thumbnail automatically
4. Camera Page
The backup camera provides proximity detection using raycasts in three zones (left, right, rear). Warnings are color-coded:
| Warning Level | Distance | Beep Interval |
|---|---|---|
| Green | Within 5.0m | 1000ms |
| Yellow | Within 3.0m | 500ms |
| Red | Within 1.0m | 200ms |
The camera also tracks vehicle speed, steering angle, and reverse gear status.
5. Vehicle Controls
Control your vehicle directly from the dashboard UI:
- Doors - Open/close all four doors individually
- Windows - Roll up/down all four windows individually
- Seats - Switch between driver, passenger, and rear seats (with cooldown)
- Engine - Toggle engine on/off with startup sound effect
- Trunk & Hood - Open/close trunk and hood
- Radio - Toggle GTA radio on/off
6. GPS Navigation
When a waypoint is set on the in-game map, the dashboard displays:
- Current street name
- Distance to waypoint (feet/miles)
- Turn-by-turn direction (straight, left, right, U-turn)
- Mini-map with player and waypoint positions
- Progress bar toward destination
Configuration
General Settings (Configs/config.lua)
Config.Keybind = 'F5' -- Key to open dashboard
Config.UIColor = "#00FFFF" -- Accent color (hex)
Config.Logo = "https://..." -- Logo URL displayed in dashboard
Config.Debug = false -- Enable debug mode
Backup Camera
Config.BackupCamera = {
AutoActivateInReverse = false, -- Auto-open camera in reverse
AutoDeactivate = true, -- Auto-close when leaving reverse
ShowGridLines = true, -- Display grid overlay
ShowDistanceWarning = true, -- Show distance warnings
ProximityBeeping = true, -- Audible proximity beeps
BeepIntervals = {
green = 1000, -- ms between beeps (far)
yellow = 500, -- ms between beeps (medium)
red = 200 -- ms between beeps (close)
}
}
Discord Integration
Config.Discord = {
Enabled = true -- Enable Discord avatar fetching
}
Config.Cache = {
AvatarCacheTime = 300000, -- Cache duration (5 minutes)
RetryAttempts = 3, -- API retry attempts
RetryDelay = 1000 -- Delay between retries (ms)
}
Config.DefaultAvatar = "https://cdn.discordapp.com/embed/avatars/0.png"
Vehicle Controls
Config.DoorControls = {
left_door = 0,
right_door = 1,
rear_left_door = 2,
rear_right_door = 3
}
Config.WindowControls = {
left_window = 0,
right_window = 1,
rear_left_window = 2,
rear_right_window = 3
}
Config.SeatControls = {
driver_seat = -1,
passenger_seat = 0,
rear_left_seat = 1,
rear_right_seat = 2,
rear_middle_seat = 3,
rear_extra_seat = 4
}
Config.OtherControls = {
trunk = 5,
hood = 4
}
Config.SeatSwitchCooldown = 2 -- Seconds between seat switches
Config.EngineStartSound = true -- Play sound on engine start
Custom Notifications
Config.Notifications = {
seatCooldown = 'Please wait before switching seats again',
seatOccupied = 'That seat is occupied',
engineStarted = 'Engine started',
radioOn = 'Radio turned on',
radioOff = 'Radio turned off'
}
Server Config (Configs/sv_config.lua)
SVConfig = {}
SVConfig.Discord = {
BotToken = "YOUR_BOT_TOKEN_HERE", -- Discord bot token
GuildId = "YOUR_SERVER_ID" -- Discord server ID
}
YouTube URL Formats
The music player accepts the following formats:
-- Full URL
https://www.youtube.com/watch?v=dQw4w9WgXcQ
-- Short URL
https://youtu.be/dQw4w9WgXcQ
-- Embed URL
https://www.youtube.com/embed/dQw4w9WgXcQ
-- Video ID only
dQw4w9WgXcQ
The script auto-converts partial URLs by prepending https://www.youtube.com/watch?v=. Song title and artist are fetched automatically from YouTube's oEmbed API.
Commands
| Command | Description | Permission |
|---|---|---|
/opendashboard |
Open the vehicle dashboard | In vehicle |
/streamer |
Toggle streamer mode (mutes audio, UI stays functional) | Everyone |
Debug Commands
Available when Config.Debug = true:
| Command | Description |
|---|---|
/backupcam |
Toggle backup camera manually |
/camproximity |
Print proximity sensor status |
/gpsinfo |
Print GPS waypoint debug info |
/weatherinfo |
Print weather detection info |
/debugavatar |
Force refresh Discord avatar |
/testdiscord |
Test Discord API connection (server) |
/clearcache |
Clear avatar cache (server) |
Discord Bot Setup
To use Discord avatar integration:
- Create a bot at
discord.com/developers/applications - Enable Server Members Intent under Privileged Gateway Intents
- Invite the bot to your Discord server
- Copy the bot token and server ID into
Configs/sv_config.lua - Players must have Discord connected to FiveM for their avatar to appear
Never share your Discord bot token. Keep sv_config.lua server-side only. The token is escrowed and cannot be accessed by clients.
Weather System
The dashboard displays real-time weather data pulled from in-game conditions:
- Compatible with
qb-weathersync(auto-detected) - Falls back to native rain level, wind speed, and cloud opacity detection
- Displays current temperature, location zone name, and condition
- Shows hourly forecast with temperature variations
- Auto-updates every 30 seconds and on weather changes
Customization
Changing the Accent Color
Set Config.UIColor to any hex color. The entire UI theme updates dynamically:
Config.UIColor = "#00FFFF" -- Cyan (default)
Config.UIColor = "#FF6B6B" -- Red
Config.UIColor = "#9b59b6" -- Purple
Config.UIColor = "#2ecc71" -- Green
Changing the Logo
Set Config.Logo to any direct image URL. The logo appears in the top-left corner of the dashboard.
Dynamic UI Updates
Other scripts can update the UI theme at runtime using the export:
exports['NR_CarPlay']:UpdateUIConfig("#FF0000", "https://your-logo-url.png")
Troubleshooting
Dashboard not opening
- Make sure you are inside a vehicle
- Check that the keybind (
F5) isn't conflicting with another resource - Try
/opendashboardas an alternative - Check F8 console for errors
No music playing
- Verify xsound is started before NR_CarPlay in server.cfg
- Check that streamer mode is not active (
/streamerto toggle) - Ensure the YouTube URL is valid
- Check if the video is region-locked or age-restricted
Discord avatar not showing
- Verify
Config.Discord.Enabled = true - Check bot token and guild ID in
sv_config.lua - Ensure the bot has Server Members Intent enabled
- Player must have Discord connected to FiveM
- Player must be in your Discord server
- Use
/debugavatarto force refresh (debug mode)
Backup camera beeping not working
- Ensure
Config.BackupCamera.ProximityBeeping = true - The camera page must be open in the dashboard for beeping to activate
- Check if objects are within 5 meters of the vehicle rear
Weather showing incorrect data
- If using qb-weathersync, ensure it's started and running
- Without a weather sync resource, the script reads native game conditions
- Use
/weatherinfoin debug mode to check detected values
Seat switching not working
- There is a 2-second cooldown between seat switches (configurable)
- The target seat must not be occupied
- The vehicle must support that many seats
Support
For paid script support, open a ticket in our Discord server for priority assistance.