Raised This Month: $204 Target: $400
 51% 

Rewrite any fire sound of AWP or AK47


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Javierko
Senior Member
Join Date: Sep 2017
Location: Czech republic
Old 07-05-2018 , 14: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
Location: Not your business.
Old 07-05-2018 , 14: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;

__________________
Taking requests, add me on Steam.

People make themselves understood in a way, others understand in another.
mug1wara is offline
Javierko
Senior Member
Join Date: Sep 2017
Location: Czech republic
Old 07-05-2018 , 14: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
Location: Not your business.
Old 07-05-2018 , 15:13   Re: Rewrite any fire sound of AWP or AK47
Reply With Quote #4

Remove the original sound file
__________________
Taking requests, add me on Steam.

People make themselves understood in a way, others understand in another.
mug1wara is offline
Javierko
Senior Member
Join Date: Sep 2017
Location: Czech republic
Old 07-05-2018 , 15: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 , 21: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 21:33.
Neuro Toxin is offline
Facksy
Senior Member
Join Date: Apr 2017
Location: Frogland
Old 07-06-2018 , 10: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
My PayPal if you like my work
Facksy is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 07-06-2018 , 10: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 07:24.


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