Raised This Month: $209 Target: $400
 52% 

[TF2] Can I replace the administrator sounds?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Theon32
Member
Join Date: Sep 2018
Location: mvm_isolation_rc3
Old 05-18-2019 , 16:43   [TF2] Can I replace the administrator sounds?
Reply With Quote #1

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

Last edited by Theon32; 05-18-2019 at 18:52.
Theon32 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-18-2019 , 19:01   Re: [TF2] Can I replace the administrator sounds?
Reply With Quote #2

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;

__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Theon32
Member
Join Date: Sep 2018
Location: mvm_isolation_rc3
Old 05-18-2019 , 20:12   Re: [TF2] Can I replace the administrator sounds?
Reply With Quote #3

Okay thanks! 1 question, does PrecacheSound make you download the sound? The sound is custom.
Theon32 is offline
CliptonHeist
Senior Member
Join Date: Feb 2016
Old 05-18-2019 , 21:06   Re: [TF2] Can I replace the administrator sounds?
Reply With Quote #4

Quote:
Originally Posted by Theon32 View Post
Okay thanks! 1 question, does PrecacheSound make you download the sound? The sound is custom.
No, AddFileToDownloadsTable() does.
CliptonHeist is offline
Theon32
Member
Join Date: Sep 2018
Location: mvm_isolation_rc3
Old 05-18-2019 , 21:25   Re: [TF2] Can I replace the administrator sounds?
Reply With Quote #5

Ahh, okay. Thanks!
Theon32 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 12:37.


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