CustomLoadingMusic - Let players choose their loading screen music
NOTE: By default there’s no music, in-game you can specify your own song to listen to, if you want. If you never specify a song, it won’t play anything on the loading url for you. It’s per player not a global setting.
So I’m pretty sure everyone is sick of hearing the dubstep music on joining servers. This addon lets people choose what music they want to play during the loading screen. The only currently accepted formats are YouTube videos but I might expand it to include MP3s and other file formats if the demand is there. By default, there won’t be any music, the player has to specify a song to hear any music on the loading screen. Anyway here’s a video that goes over the addon:
The only requirements for getting this up and running are as follows:
- MySQL server
- Web host with PHP
- A little bit of time/knowledge to set it up
Once you've put the folder into the 'addons' folder then follow these steps; 1.) Ensure that your web host supports PHP (hosting this on Dropbox won't work) 2.) Ensure that your loadingurl file ends in .php 3.) Fill in the database credentials in both the lua/autorun/server/clm_main.lua and loadingurl.php 4.) Add the following code to your current loadingurl and put loadingurl.php in the same file location as your current loadingurl. <?php include('loadingurl.php'); ?> 5.) Import the .sql dump into phpmyadmin (make sure the database name is 'songs') 6.) Make sure your loadingurl has the SteamID variable set, here's an example: sv_loadingurl "http://mywebsite.com/index.php?steamid=%s (the important bit being ?steamid=%s)
There are server-side checks to ensure that the URL is a YouTube URL but if you do find any exploits then let me know, this was thrown together in just under a day.
NOTE: Bear in mind YouTube does block a lot of embedding of videos so if a video doesn’t work then there’s not a lot I can do unfortunately.