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!
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!