View Single Post
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