Raised This Month: $32 Target: $400
 8% 

Rewrite any fire sound of AWP or AK47


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Javierko
AlliedModders Donor
Join Date: Sep 2017
Location: Czech republic
Old 07-05-2018 , 13:20   Rewrite any fire sound of AWP or AK47
Reply With Quote #1

Hello, can somebody help me with rewriting fire sound of awp or ak?
Thanks.
__________________
My Github & Sourcemod work.
If you like my work and if you want to support me, you can through PayPal.

Official SourceMod CZ/SK Discord: https://discord.gg/Qvar55a
Javierko is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 07-05-2018 , 13:43   Re: Rewrite any fire sound of AWP or AK47
Reply With Quote #2

sample:

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

#pragma semicolon 1

public void OnPluginStart()
{
    
HookEvent("weapon_fire"Event_FireEventHookMode_Pre);
}

public 
void OnMapStart()
{
    
PrecacheSound("your/sound.mp3");
    
    
AddFileToDownloadsTable("sound/your/sound.mp3");
}

public 
Action Event_Fire(Event hEvent, const char[] sNamebool bDontBroadcast)
{
    
int iClient GetClientOfUserId(hEvent.GetInt("userid"));
    
    
char sWeapon[32];
    
GetClientWeapon(iClientsWeaponsizeof(sWeapon));
    
    if (
StrEqual(sWeapon"weapon_awp"))
    {
        
EmitSoundToAllAny("your/sound.mp3");
        
        return 
Plugin_Stop;
    }
    
    return 
Plugin_Continue;

mug1wara is offline
Javierko
AlliedModders Donor
Join Date: Sep 2017
Location: Czech republic
Old 07-05-2018 , 13:59   Re: Rewrite any fire sound of AWP or AK47
Reply With Quote #3

Play sound works, but there is played default song from CS:GO too.
Is there way to remove that CS:GO sound?
__________________
My Github & Sourcemod work.
If you like my work and if you want to support me, you can through PayPal.

Official SourceMod CZ/SK Discord: https://discord.gg/Qvar55a
Javierko is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 07-05-2018 , 14:13   Re: Rewrite any fire sound of AWP or AK47
Reply With Quote #4

Remove the original sound file
mug1wara is offline
Javierko
AlliedModders Donor
Join Date: Sep 2017
Location: Czech republic
Old 07-05-2018 , 14:21   Re: Rewrite any fire sound of AWP or AK47
Reply With Quote #5

I cant find any path on server with original awp sound file.

There must be another way to remove. Maybe using SoundHook.
__________________
My Github & Sourcemod work.
If you like my work and if you want to support me, you can through PayPal.

Official SourceMod CZ/SK Discord: https://discord.gg/Qvar55a
Javierko is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 07-05-2018 , 20:33   Re: Rewrite any fire sound of AWP or AK47
Reply With Quote #6

If we talking csgo. The client most likely predicts and plays the sound. So you cant block it for the player themselfs. Other players should hear the updated sound however.
__________________

Last edited by Neuro Toxin; 07-05-2018 at 20:33.
Neuro Toxin is offline
Facksy
Senior Member
Join Date: Apr 2017
Location: +2+2
Old 07-06-2018 , 09:02   Re: Rewrite any fire sound of AWP or AK47
Reply With Quote #7

sv_client_predict 0 ?
__________________
My Steam I take private requests if related with TF2
My Plugins
Facksy is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 07-06-2018 , 09:25   Re: Rewrite any fire sound of AWP or AK47
Reply With Quote #8

Lol. You can't play like that...
__________________
Neuro Toxin 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 03:18.


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