Raised This Month: $51 Target: $400
 12% 

Making clients download sounds from server


Post New Thread Reply   
 
Thread Tools Display Modes
Dragonshadow
BANNED
Join Date: Jun 2008
Old 07-05-2009 , 22:21   Re: Making clients download sounds from server
Reply With Quote #11

PHP Code:
   PrecacheSound("sound/humiliation.mp3"
maybe?
Dragonshadow is offline
foot33333
Junior Member
Join Date: Jul 2009
Old 07-05-2009 , 22:38   Re: Making clients download sounds from server
Reply With Quote #12

Quote:
Originally Posted by Dragonshadow View Post
PHP Code:
   PrecacheSound("sound/humiliation.mp3"
maybe?
when I do this my server console says:

Code:
SV_StartSound: humiliation.mp3 not precached (0)
SV_StartSound: humiliation.mp3 not precached (0)
SV_StartSound: humiliation.mp3 not precached (0)
SV_StartSound: humiliation.mp3 not precached (0)

I am guessing that it it is trying to play it to all 4 players and is having problems everytime. With this change I do not get the error in my client console but the sound doesn't play either
foot33333 is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 07-06-2009 , 05:41   Re: Making clients download sounds from server
Reply With Quote #13

AFAIK you don't need to specify "sounds" folder when use PrecacheSound. If sound path is "<mod>/sound/humiliation.mp3", do this:
PHP Code:
PrecacheSound("humiliation.mp3"); 
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
foot33333
Junior Member
Join Date: Jul 2009
Old 07-06-2009 , 10:21   Re: Making clients download sounds from server
Reply With Quote #14

I don't have the folder specified currently. This is the code that I have:

Code:
#include <sourcemod>
#include <sdktools>


new DamageArray[8] = {0, 0, 0, 0, 0, 0, 0, 0,};


public OnPluginStart()
{
   
   HookEvent("player_death", Event_PlayerDeath)
   HookEvent("player_hurt", Event_PlayerHurt)
}

public OnMapStart()
{
   AddFileToDownloadsTable("sound/humiliation.mp3");
   PrecacheSound("humiliation.mp3")
}



public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
   new victim_id = GetEventInt(event, "userid")

   if(DamageArray[victim_id] == 0){
    PrintToServer("embarrased")
    EmitSoundToAll("humiliation.mp3")
   }
   PrintToServer("a death occurred")
    
   DamageArray[victim_id] = 0


 

}


public Event_PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast)
{

   new attacker_id = GetEventInt(event, "attacker")

   DamageArray[attacker_id] = 1
 
}
and this is the error that I see in the client console
Code:
"S_StartSound: Failed to load sound 'humiliation.mp3', file probably missing form disk/repository"

also, if I change:

Code:
 EmitSoundToAll("humiliation.mp3")
to

Code:
 EmitSoundToAll("sound/humiliation.mp3")
I get the error:

Code:
"S_StartSound: Failed to load sound 'sound\humiliation.mp3', file probably missing form disk/repository"

Last edited by foot33333; 07-06-2009 at 10:23.
foot33333 is offline
derfelsinderbrandung
New Member
Join Date: Jan 2010
Old 01-10-2010 , 15:25   Re: Making clients download sounds from server
Reply With Quote #15

Hi,
I have absolutely no idea if this might help, but before i began to search for "how to play custom sounds", i tried a few things myself to get the "Quake Sounds" Plugin running on my L4D2 Listening Server.

"play" or "sm_play" always results in missing file error
but with "playgamesound" it works for me

dont know if "snd_audiorebuildcache" did do its part too, but the sounds now work for me while cutting down zombies

(ignore if the cmd isnt the point - iam just a user ;))
derfelsinderbrandung is offline
Oshroth
Senior Member
Join Date: Dec 2009
Old 06-09-2010 , 02:10   Re: Making clients download sounds from server
Reply With Quote #16

From my experience, custom sounds in L4D/2 won't play unless you have used "snd_audiorebuildcache" after downloading them. Basically L4D/2 won't play a sound that isn't in the audio cache, it 'll pop up that error you've been seeing about "Failed to load sound, file probably missing form disk/repository" even if the sound is in the correct place.
__________________
Oshroth is offline
Whosat
Senior Member
Join Date: Nov 2007
Location: Singapore
Old 06-09-2010 , 23:19   Re: Making clients download sounds from server
Reply With Quote #17

Have you verified that the file was actually downloaded? Go to the folder and look for the file. (If it isn't there, its either your code's fault or L4D's fault. Last I read L4D didn't allow file downloads)
__________________
Whosat is offline
McFlurry
Veteran Member
Join Date: Mar 2010
Location: RemoveEdict(0);
Old 06-10-2010 , 00:45   Re: Making clients download sounds from server
Reply With Quote #18

The only way you would be able to get custom sounds for l4d/l4d2 to work would be to make the plugin edit the audio.cache file for each client, though no one has implemented that method yet...
__________________
McFlurry is offline
Send a message via Skype™ to McFlurry
Master53
Veteran Member
Join Date: Dec 2009
Old 06-10-2010 , 17:52   Re: Making clients download sounds from server
Reply With Quote #19

http://forums.alliedmods.net/showthread.php?t=129247
go to
PHP Code:
public OnMapStart(){ 
and place
PHP Code:
    PrecacheSound("SilePath+FileType");
      
//Example
    
PrecacheSound("humiliation.mp3"); 
__________________
Master(d)



Master53 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:13.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode