[RELEASE] [PAID] Car Music Player Script (w/ Logs) [QBCore]

Hey everyone! This is a script that allows players on your FiveM server to jam out to music with their friends and with a beautiful custom-made UI (NUI). It also has a detailed logging feature which logs to a file and/or server console (configurable) whenever a player plays music with a direct link to the song, which makes it easy to moderate the usage of the radio. I hope you all enjoy and find this useful for the players on your server! :notes:

Features:
↳ Logs
↳ Extensive configuration
↳ Play/pause, rewind/fast forward, stop, volume control functions
↳ Video thumbnail & title
↳ Music timestamp
↳ Music synced across all clients
↳ Spatial/3D audio
… and even more coming in future updates!

Dependencies:
↳ QBCore Framework
↳ xSound
↳ YouTube Data API Key (This is completely free - tutorial on how to get a key is included in the README)

Buy ($10):
↳ Tebex

Showcase:

Watch Car Music Radio Script (w/ Logs) | @NadPlayz | Streamable (Try this link if preview does not work)

Configuration:

Config = {}
Locale = {}

-- [[ 🟒 Configuration 🟒 ]] --

-- QBCore
Config.qbVersion = 'new' -- Change to 'new' if you are using the new QBCore version. If you do not, core functions of the script will simply not work!

-- General
Config.ytAPIKey = "" -- YouTube API key is used to get the thumbnail and video name. Instructions: https://bit.ly/3lAPorQ. Do not hesitate to join my Discord for support.
Config.musicDistance = 3 -- How far you can be from the vehicle and still be able to hear the music
Config.defaultImage = "https://i.imgur.com/T1rEs73.jpg" -- Default image displayed on the radio when no music is playing
Config.refreshRate = 100 -- Lower = better quality but worse performance (100 is a good balance)

-- Logs
Config.enableLogs = true -- Change this to false if you want to disable logs
Config.logToFile = true -- Change this to false if you do not want to log to a file // NOTE: Must have a 'log.txt' file in the resource folder.
Config.printToConsole = true -- Change this to false if you do not want every event to print to server console
Config.logToDiscord = false -- Change this to true and set the webhook URL below if you want every event to be sent to a Discord webhook
Config.discordWebhook = "" -- Make sure to set the above option to true if you wish to send logs to Discord

-- [[ πŸ”΄ Configuration πŸ”΄ ]] --


-- [[ 🟒 Locale 🟒 ]] --

-- General
Locale.nothingPlaying = "NOTHING PLAYING"
Locale.songURL = "Song URL (YouTube)"

-- Notifications
Locale.radioInUse = "Your radio is in use in another vehicle"

-- Logs
Locale.radio = "Vehicle Radio"
Locale.played = " played "

-- [[ πŸ”΄ Locale πŸ”΄ ]] --

Note:
Protected by FiveM Asset Escrow system.

If you have any questions, please feel free to message me here - I would be more than happy to help. I appreciate feedback and constructive criticism. Thank you! :heart:

2 Likes

streamermode?

1 Like

Yes, streamer mode can be toggled through xSound by using the /streamermode command. Thanks for your comment!

1 Like

Awesome!

Is code encrypted, if I wanna convert this to our own framework? (Not QBCore)

Yes, the code is encrypted through the FiveM Asset Escrow system. However, I will most likely release a standalone version within the coming days. Thanks for your comment!

Will be looking forward to it!

At the moment, I do not plan on making an ESX version but I may make a standalone variant in the future.

The music after 50 mph, gets wavy like its trying to keep up. Any fix for this?

does this support YouTube playlist?

You cant use this script, after 45 mph the sound is crap and lags behind horribly. Great interface but overall doesnt work well at all.

It’s much better than this.

How i convert this script in item?