Raised This Month: $ Target: $400
 0% 

[L4D2] Mute/Replace Tank Music Serverside?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dethl
Junior Member
Join Date: Sep 2011
Old 04-21-2014 , 00:31   Re: [L4D2] Mute/Replace Tank Music Serverside?
Reply With Quote #1

Tried doing it myself based off of this and its not working. (I have very little knowledge of C++ and even less of Sourcemod's API)

Here's what I got so far, what did I screw up on?

Code:
#include <sourcemod>
#include <sdktools>
     
#define NEW_TANK_SOUND "tankcustom.wav"
#define NEW_TANK_SOUND_FILE "addons/MSFT/sound/tankcustom.wav"
#define NEW_TANK_SOUND_FILE_CACHE "addons/MSFT/sound/sound.cache"
   
public OnPluginStart()
{
    HookEvent("tank_spawn", Event_Audio, EventHookMode_Pre);
    HookEvent("finale_start", Event_Audio, EventHookMode_Pre);
}
     
public OnMapStart()
{
    PrecacheSound(NEW_TANK_SOUND);
     
    AddFileToDownloadsTable(NEW_TANK_SOUND_FILE);
    AddFileToDownloadsTable(NEW_TANK_SOUND_FILE_CACHE);
}
     
public Action:Event_Audio(Handle:event, const String:name[], bool:dontBroadcast)
{
    new String:strAudio[40];
    GetEventString(event, "sound", strAudio, sizeof(strAudio));
    EmitSoundToAll(NEW_TANK_SOUND);
    return Plugin_Continue;
}
Dethl 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 04:25.


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