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

[CSGO-Req] weapon sounds changer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sHoC
Senior Member
Join Date: Nov 2015
Location: Italy
Old 08-10-2018 , 01:55   [CSGO-Req] weapon sounds changer
Reply With Quote #1

Hello as the tittle say, can anyone make a plugin that let you to change sound of weapons, or is there any plugin like it, cuz I didnt find anything like it. I want to change only the fire sound.
__________________
sHoC is offline
Rachnus
Senior Member
Join Date: Jun 2016
Location: Funland
Old 08-10-2018 , 07:56   Re: [CSGO-Req] weapon sounds changer
Reply With Quote #2

Dont think its possible since the sound you hear from your own gun when you fire is client sided, have not found a way to do it myself.
__________________
Github: https://github.com/jimppan
Steam: http://steamcommunity.com/id/jimppan
_____________________________________________ _________
Taking private requests
Rachnus is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 08-10-2018 , 12:43   Re: [CSGO-Req] weapon sounds changer
Reply With Quote #3

It is possible to emit the sound to everyone, then adjust the volume with the distance from the other players to the client.
mug1wara is offline
LenHard
Senior Member
Join Date: Jan 2016
Old 08-10-2018 , 23:18   Re: [CSGO-Req] weapon sounds changer
Reply With Quote #4

You'll always hear your own gun, but you could alter the sound for other people's guns. You could try to override your gun sound with another sound to try and overlap it.
__________________
LenHard is offline
sHoC
Senior Member
Join Date: Nov 2015
Location: Italy
Old 08-11-2018 , 01:52   Re: [CSGO-Req] weapon sounds changer
Reply With Quote #5

There is possible to change the weapons sounds fire, there was an update, and now you can change the sound like in counter strike 1.6, I know a servere with a different sounds for weapons, can anyone make the script?
__________________
sHoC is offline
Bara
AlliedModders Donor
Join Date: Apr 2012
Location: Germany
Old 08-11-2018 , 05:07   Re: [CSGO-Req] weapon sounds changer
Reply With Quote #6

Quote:
Originally Posted by sHoC View Post
there was an update, and now you can change the sound
That would be new for me. So far i know, own gun sounds are client side.
__________________
Discord (Bara#5006) | My Plugins (GitHub)
You like my work? Support is not a crime.

Last edited by Bara; 08-11-2018 at 05:11.
Bara is offline
sHoC
Senior Member
Join Date: Nov 2015
Location: Italy
Old 08-12-2018 , 10:54   Re: [CSGO-Req] weapon sounds changer
Reply With Quote #7

Quote:
Originally Posted by Bara View Post
That would be new for me. So far i know, own gun sounds are client side.
nope now you can change the sounds of a weapon. can you script a code so we can test it togheter?
__________________
sHoC is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 08-12-2018 , 13:09   Re: [CSGO-Req] weapon sounds changer
Reply With Quote #8

PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>
#include <emitsoundany> // you need to find this file

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

public 
void OnMapStart()
{
    
AddFileToDownloadsTable("sound/oldcs/ak47-1.wav"); // with sound folder in path
    
PrecacheSoundAny("oldcs/ak47-1.wav"); // without sound folder in path
}

public 
Action SoundHook(int clients[64], int &numClientschar sound[PLATFORM_MAX_PATH], int &entityint &channelfloat &volumeint &levelint &pitchint &flags)
{
    if(
StrContains(sound"weapons/knife/knife_hit_") != -1// you must search for the sound that you want to replace (you will find them in pak_dir.vpk from csgo folder). you can open that file with gfscape
    
{        
        
EmitSoundToAllAny("oldcs/ak47-1.wav"entitychannellevelflagsvolumepitch);
        return 
Plugin_Stop;
    }
    
    return 
Plugin_Continue;

__________________
Ilusion9 is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 08-12-2018 , 13:44   Re: [CSGO-Req] weapon sounds changer
Reply With Quote #9

Quote:
Originally Posted by Ilusion9 View Post
PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>
#include <emitsoundany> // you need to find this file

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

public 
void OnMapStart()
{
    
AddFileToDownloadsTable("sound/oldcs/ak47-1.wav"); // with sound folder in path
    
PrecacheSoundAny("oldcs/ak47-1.wav"); // without sound folder in path
}

public 
Action SoundHook(int clients[64], int &numClientschar sound[PLATFORM_MAX_PATH], int &entityint &channelfloat &volumeint &levelint &pitchint &flags)
{
    if(
StrContains(sound"weapons/knife/knife_hit_") != -1// you must search for the sound that you want to replace (you will find them in pak_dir.vpk from csgo folder). you can open that file with gfscape
    
{        
        
EmitSoundToAllAny("oldcs/ak47-1.wav"entitychannellevelflagsvolumepitch);
        return 
Plugin_Stop;
    }
    
    return 
Plugin_Continue;


You dont need emitsoundany on csgo.
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.


Last edited by Franc1sco; 08-12-2018 at 13:45.
Franc1sco is offline
Send a message via MSN to Franc1sco
Hallucinogenic Troll
Senior Member
Join Date: Apr 2015
Old 08-12-2018 , 14:22   Re: [CSGO-Req] weapon sounds changer
Reply With Quote #10

Tested and I couldn't block any knife sounds.
Tested with AK-47, Deagle and AWP as well, but didn't show any sound (tested with the version above, with a PrintToChat to show all the sounds that are played).

It still plays the sound, but doesn't override the default one.
Tested with this version:

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

#pragma newdecls required

#define SOUND "misc/ptfun/nope.mp3"

public Plugin myinfo =
{
    
name "[CS:GO] Some Test",
    
author "Hallucinogenic Troll (some parts by Ilusion9)",
    
version "1.0",
    
description "Weapon Sound Test Change",
    
url ""
};

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


public 
void OnMapStart()
{
    
char buffer[PLATFORM_MAX_PATH];
    
Format(buffersizeof(buffer), "sound/%s"SOUND);
    
AddFileToDownloadsTable(buffer);
    
Format(buffersizeof(buffer), "*/%s"SOUND);
    
FakePrecacheSound(buffer);
}

public 
Action SoundHook(int clients[64], int &numClientschar sound[PLATFORM_MAX_PATH], int &entityint &channelfloat &volumeint &levelint &pitchint &flags)
{
    
PrintToChatAll(sound);
    if(
StrContains(sound"weapons/knife/knife_slash2") != -1// you must search for the sound that you want to replace (you will find them in pak_dir.vpk from csgo folder). you can open that file with gfscape
    
{        
        
char buffer[PLATFORM_MAX_PATH];
        
Format(buffersizeof(buffer), "*/%s"SOUND);
        
EmitSoundToAll(bufferentitychannellevelflagsvolumepitch);
        return 
Plugin_Stop;
    }
    
    return 
Plugin_Continue;
}

// https://wiki.alliedmods.net/Csgo_quirks
stock void FakePrecacheSound(const char[] szPath)
{
    
AddToStringTable(FindStringTable("soundprecache"), szPath);

__________________

Last edited by Hallucinogenic Troll; 08-12-2018 at 14:24.
Hallucinogenic Troll 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 09:06.


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