• Clients don't hear downloaded songs
    1 replies, posted
So I am having a problem with songs on my server. [B]I DO NOT USE FASTDL[/B] [CODE]// // sv_end_round_music.lua by Josh 'Acecool' Moser // // // Define your music here, end each line with a , // You can define 1 to many sounds. It will play 1 of the list randomly, or the single one every time. // END_OF_ROUND_WIN_INNOCENT_SOUNDS = { "sound11.mp3", "sound55.mp3", "sound1337.mp3", } END_OF_ROUND_WIN_TRAITOR_SOUNDS = { "sound55.mp3", "sound11.mp3", "sound1337.mp3", } END_OF_ROUND_WIN_TIMELIMIT_SOUNDS = { "sound1337.mp3", } // You must define a default sound to play if some of your lists above are empty. END_OF_ROUND_WIN_DEFAULT_SOUND = "sound8.mp3"; if ( SERVER ) then util.AddNetworkString( "_ttt_end_round_music" ); resource.AddFile("sound/sound11.mp3") resource.AddFile("sound/sound55.mp3") resource.AddFile("sound/sound1337.mp3") for k, v in pairs( END_OF_ROUND_WIN_INNOCENT_SOUNDS ) do resource.AddFile( "sound/" .. v ); end for k, v in pairs( END_OF_ROUND_WIN_TRAITOR_SOUNDS ) do resource.AddFile( "sound/" .. v ); end for k, v in pairs( END_OF_ROUND_WIN_TIMELIMIT_SOUNDS ) do resource.AddFile( "sound/" .. v ); end local function endofround( wintype ) // Default sound local _sound = END_OF_ROUND_WIN_DEFAULT_SOUND if wintype == WIN_INNOCENT then _sound = table.Random( END_OF_ROUND_WIN_INNOCENT_SOUNDS ); elseif wintype == WIN_TRAITOR then _sound = table.Random( END_OF_ROUND_WIN_TRAITOR_SOUNDS ); elseif wintype == WIN_TIMELIMIT then _sound = table.Random( END_OF_ROUND_WIN_TIMELIMIT_SOUNDS ); end net.Start( "_ttt_end_round_music" ); net.WriteString( _sound ); net.Broadcast( ); end hook.Add( "TTTEndRound", "Handymanendofround", endofround ) end[/CODE] And the song file is located in sounds/sound1337.mp3 The problem is that even though I download the song as a client, when I am in the server and try to play it by using ulx_playsound sound1337.mp3 it does not play it. It simply prompts out console error: [CODE]Failed to load sound "sound1337.mp3", file probably missing from disk/repository[/CODE] Any ideas how to fix this without setting up FASTDL ?
BUMP I understand this is a very old topic, but I have went trough quite alot of end round music scripts and none worked so I came back to the one that did work somewhat... But now it is not working... Any help would be appriciated... I can play the sound trought ulx_playsound but the script itself doesn't play the sound... Failed to load sound "", file probably missing from disk/repository [lua] // // sv_end_round_music.lua by Josh 'Acecool' Moser // // // Define your music here, end each line with a , // You can define 1 to many sounds. It will play 1 of the list randomly, or the single one every time. // END_OF_ROUND_WIN_INNOCENT_SOUNDS = { "exile1.mp3", "exile1.mp3", "exile1.mp3", } END_OF_ROUND_WIN_TRAITOR_SOUNDS = { "exile2.mp3", "exile2.mp3", "exile2.mp3", } END_OF_ROUND_WIN_TIMELIMIT_SOUNDS = { "exile2.mp3", } // You must define a default sound to play if some of your lists above are empty. END_OF_ROUND_WIN_DEFAULT_SOUND = "exile2.mp3"; if ( SERVER ) then util.AddNetworkString( "_ttt_end_round_music" ); resource.AddFile("sound/exile1.mp3") resource.AddFile("sound/exile2.mp3") for k, v in pairs( END_OF_ROUND_WIN_INNOCENT_SOUNDS ) do resource.AddFile( "sound/" .. v ); end for k, v in pairs( END_OF_ROUND_WIN_TRAITOR_SOUNDS ) do resource.AddFile( "sound/" .. v ); end for k, v in pairs( END_OF_ROUND_WIN_TIMELIMIT_SOUNDS ) do resource.AddFile( "sound/" .. v ); end local function endofround( wintype ) // Default sound local _sound = END_OF_ROUND_WIN_DEFAULT_SOUND if wintype == WIN_INNOCENT then _sound = table.Random( END_OF_ROUND_WIN_INNOCENT_SOUNDS ); elseif wintype == WIN_TRAITOR then _sound = table.Random( END_OF_ROUND_WIN_TRAITOR_SOUNDS ); elseif wintype == WIN_TIMELIMIT then _sound = table.Random( END_OF_ROUND_WIN_TIMELIMIT_SOUNDS ); end net.Start( "_ttt_end_round_music" ); net.WriteString( _sound ); net.Broadcast( ); end hook.Add( "TTTEndRound", "Handymanendofround", endofround ) end [/lua]
Sorry, you need to Log In to post a reply to this thread.