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

[CSGO-Req] weapon sounds changer


Post New Thread Reply   
 
Thread Tools Display Modes
Bara
AlliedModders Donor
Join Date: Apr 2012
Location: Germany
Old 08-12-2018 , 16:35   Re: [CSGO-Req] weapon sounds changer
Reply With Quote #11

But it just works for player who doesn't have this weapon/knife in the hand. Used this code as example/test:
Code:
#include <sourcemod>
#include <sdktools>

#pragma newdecls required

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

public Action SoundHook(int clients[64], int &numClients, char sound[PLATFORM_MAX_PATH], int &entity, int &channel, float &volume, int &level, int &pitch, int &flags)
{
    PrintToChatAll(sound);
    return Plugin_Stop;
}
__________________
Discord (Bara#5006) | My Plugins (GitHub)
You like my work? Support is not a crime.
Bara is offline
rogeraabbccdd
Veteran Member
Join Date: Jun 2015
Location: de_dust2
Old 08-13-2018 , 08:17   Re: [CSGO-Req] weapon sounds changer
Reply With Quote #12

Hook weapon_fire?
__________________

Please keep in mind, nobody have responsibility to help you, especially who don't try to Google first.
I only read messages in Chinese and English.

GitHub | Discord:Kento#2118
rogeraabbccdd is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 08-13-2018 , 08:19   Re: [CSGO-Req] weapon sounds changer
Reply With Quote #13

Quote:
Originally Posted by rogeraabbccdd View Post
Hook weapon_fire?
Great idea. Take notes ya'll.
mug1wara is offline
sHoC
Senior Member
Join Date: Nov 2015
Location: Italy
Old 08-13-2018 , 11:18   Re: [CSGO-Req] weapon sounds changer
Reply With Quote #14

Quote:
Originally Posted by rogeraabbccdd View Post
Hook weapon_fire?
Can you share a script with hook weapon_fire
Thank you in advice.
__________________
sHoC is offline
LenHard
Senior Member
Join Date: Jan 2016
Old 08-13-2018 , 22:28   Re: [CSGO-Req] weapon sounds changer
Reply With Quote #15

Quote:
Originally Posted by sHoC View Post
Can you share a script with hook weapon_fire
Thank you in advice.
r/woooosh

You can't alter weapon fire sound with the hook weapon_fire...
__________________
LenHard is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 08-14-2018 , 10:31   Re: [CSGO-Req] weapon sounds changer
Reply With Quote #16

Quote:
Originally Posted by mug1wara View Post
Great idea. Take notes ya'll.
have you tested that to be a great idea?

you can emit sounds in weapon_fire, but you cannot block them.
you can block them in AddNormalSoundHook, but who knows if will work fine.
__________________
Ilusion9 is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 08-14-2018 , 14:36   Re: [CSGO-Req] weapon sounds changer
Reply With Quote #17

Quote:
Originally Posted by Ilusion9 View Post
have you tested that to be a great idea?

you can emit sounds in weapon_fire, but you cannot block them.
you can block them in AddNormalSoundHook, but who knows if will work fine.
I was sarcastic...
mug1wara is offline
brunoronning
Senior Member
Join Date: Jan 2014
Location: Brazil
Old 08-14-2018 , 20:16   Re: [CSGO-Req] weapon sounds changer
Reply With Quote #18

Must be working:

Spoiler


BUT it is not possible to block the original sound for who are shooting due to the client's predict (that is, you will hear both sounds), just for the other players.

Last edited by brunoronning; 08-14-2018 at 20:18.
brunoronning is offline
sHoC
Senior Member
Join Date: Nov 2015
Location: Italy
Old 08-16-2018 , 15:49   Re: [CSGO-Req] weapon sounds changer
Reply With Quote #19

Quote:
Originally Posted by brunoronning View Post
Must be working:

Spoiler


BUT it is not possible to block the original sound for who are shooting due to the client's predict (that is, you will hear both sounds), just for the other players.
what I have to edit in the source code? to add the sound for awp?
__________________
sHoC is offline
TheZZL
Junior Member
Join Date: Sep 2020
Location: East Coast US
Old 03-22-2021 , 07:01   Re: [CSGO-Req] weapon sounds changer
Reply With Quote #20

Quote:
Originally Posted by brunoronning View Post
Must be working:

Spoiler


BUT it is not possible to block the original sound for who are shooting due to the client's predict (that is, you will hear both sounds), just for the other players.
I went ahead and compiled with no errors, but then recieved this in-game when I shoot

[Sound] S_StartSound(): Failed to load sound '*\custom\weapons\new_ak47.mp3'. File is missing from disk or is invalid.

File path for FDL and server is /csgo/sound/custom/weapons

If it helps, when I shoot the AK it cuts off any other sound that plays, and each time I shoot the error I put above is put into console twice.
TheZZL is offline
Reply



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 00:57.


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