AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [TF2] Can I replace the administrator sounds? (https://forums.alliedmods.net/showthread.php?t=316349)

Theon32 05-18-2019 16:43

[TF2] Can I replace the administrator sounds?
 
I want to know if I can replace the administrator sounds (E.g. "Alert! The control point is being contested!") if you are on blue team. Can I?

Thanks! -Theon

Powerlord 05-18-2019 19:01

Re: [TF2] Can I replace the administrator sounds?
 
I don't remember if the point contested sounds are client-side or not.

If they aren't client-side, then yes, using a normal sound hook. Something like

PHP Code:

// without the sounds/ directory
const char[] mySound "mysound.mp3";

public 
void OnPluginStart()
{
    
AddNormalSoundHook(SoundHook);
}

public 
void OnMapStart()
{
    
PrecacheSound("sounds/" ... mySound);
}

public 
Action SoundHook(int clients[], intnumClientschar sample[], intentityintchannel,
    
floatvolumeintlevelintpitchintflagschar soundEntry[], intseed)
{
    if (
StrContains(sample"vo/announcer_control_point_warning") ||
        
StrContains(sample"vo/announcer_control_point_warning2") ||
        
StrContains(sample"vo/announcer_control_point_warning3"))
    {
        
EmitSound(clientsnumClientsmySoundentitychannellevelflagsvolumepitch);
        
// block original sound
        
return Plugin_Stop;
    }
    return 
Plugin_Continue;



Theon32 05-18-2019 20:12

Re: [TF2] Can I replace the administrator sounds?
 
Okay thanks! 1 question, does PrecacheSound make you download the sound? The sound is custom.

CliptonHeist 05-18-2019 21:06

Re: [TF2] Can I replace the administrator sounds?
 
Quote:

Originally Posted by Theon32 (Post 2652225)
Okay thanks! 1 question, does PrecacheSound make you download the sound? The sound is custom.

No, AddFileToDownloadsTable() does.

Theon32 05-18-2019 21:25

Re: [TF2] Can I replace the administrator sounds?
 
Ahh, okay. Thanks!


All times are GMT -4. The time now is 06:37.

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