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

[L4D2] Custom Sound Help!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bman87
Senior Member
Join Date: Dec 2008
Location: Michigan
Old 03-12-2010 , 16:16   [L4D2] Custom Sound Help!
Reply With Quote #1

Please help! I cannot get this plugin to work.

The file downloads correctly, I can join the server and it transfers the file. But when I type the sm_haha command I do not hear the file play.

When I check my sound folder it created the tchalo directory and transfered the .wav file successfully. I am able to play the .wav in a media player.

Typing: 'play tchalo/haha3.wav' in the console does not work. Failed to load file...

Any ideas?

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

#define VERSION "1.1"

#define HAHASOUND "tchalo/haha3.wav"

public Plugin:myinfo =
{
    
name "L4D2 Sound Loader Test",
    
author "B-man",
    
description "TCHalo Servers",
    
version VERSION,
    
url "http://www.tchalo.com"
}

public 
OnPluginStart()
{
    
RegAdminCmd("sm_haha"playerLaughADMFLAG_GENERIC"Nelsons' Ha-ha!");
}

public 
OnMapStart()
{
    
AddFileToDownloadsTable("sound\\tchalo\\haha3.wav");
    
CallCacheSounds();
}

public 
Action:playerLaugh(clientargs)
{
    
EmitSoundToAll(HAHASOUND);
    
PrintToChat(client"Hah-ha!");
}

public 
CallCacheSounds()
{
    
PrecacheSound(HAHASOUNDfalse); 

bman87 is offline
Oshroth
Senior Member
Join Date: Dec 2009
Old 03-13-2010 , 03:50   Re: [L4D2] Custom Sound Help!
Reply With Quote #2

I think this might be a problem with L4D2 itself. In my experience L4D2 won't play any sound files that are not in the sound cache, although I might be wrong.
Oshroth is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 03-13-2010 , 04:17   Re: [L4D2] Custom Sound Help!
Reply With Quote #3

Correct. Until you/any client run snd_rebuildaudiocache, you wont hear a thing.
AtomicStryker is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 03-13-2010 , 06:59   Re: [L4D2] Custom Sound Help!
Reply With Quote #4

Interesting. I can force people to download coloured laser sights with this method, but they will have to restart the game before the vpk starts working.
Is their anyway to make the client reload his vpk files on connection?

I remeber you could call a command manually to do this, but is there anyway to let the client call it automaticly? So they could have green laser sights for example, directly after joining the server.

This one to be more exact.
update_addon_paths - Reloads the search paths for game addons.

Last edited by Visual77; 03-13-2010 at 07:05.
Visual77 is offline
alexip121093
Senior Member
Join Date: Dec 2009
Location: Hong Kong
Old 03-13-2010 , 07:26   Re: [L4D2] Custom Sound Help!
Reply With Quote #5

Wonder there have anotherway need not rebuild sounds cache

Quote:
Originally Posted by Visual77 View Post
Interesting. I can force people to download coloured laser sights with this method, but they will have to restart the game before the vpk starts working.
Is their anyway to make the client reload his vpk files on connection?

I remeber you could call a command manually to do this, but is there anyway to let the client call it automaticly? So they could have green laser sights for example, directly after joining the server.

This one to be more exact.
update_addon_paths - Reloads the search paths for game addons.
AddFileToDownloadsTable support vpk files?
alexip121093 is offline
Send a message via MSN to alexip121093
Visual77
Veteran Member
Join Date: Jan 2009
Old 03-13-2010 , 07:35   Re: [L4D2] Custom Sound Help!
Reply With Quote #6

Yeah, even vpk.
Visual77 is offline
bman87
Senior Member
Join Date: Dec 2008
Location: Michigan
Old 03-13-2010 , 14:14   Re: [L4D2] Custom Sound Help!
Reply With Quote #7

Quote:
Originally Posted by AtomicStryker View Post
Correct. Until you/any client run snd_rebuildaudiocache, you wont hear a thing.
Can I use one of the ClientCommand() functions to send the snd_rebuildcache command?
bman87 is offline
ChrisP
Member
Join Date: Jan 2010
Old 03-13-2010 , 15:19   Re: [L4D2] Custom Sound Help!
Reply With Quote #8

You wouldn't want to have them rebuild their audio cache because it takes a long time, much longer than them restarting their game. I too would like a way to make the sounds, as well as custom particle effects and textures, work without the client restarting their game, but I cant find a viable method for any of them.
ChrisP is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 03-13-2010 , 16:26   Re: [L4D2] Custom Sound Help!
Reply With Quote #9

Where is the audiocache, anyway? If its a small file perhaps we could force upload it on them?
AtomicStryker is offline
kiraibrasil
Member
Join Date: Jun 2009
Old 03-13-2010 , 21:49   Re: [L4D2] Custom Sound Help!
Reply With Quote #10

Afake client play a hls
kiraibrasil is offline
Reply


Thread Tools
Display Modes

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 04:44.


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