AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=58)
-   -   CSGO What's the plugin for hs bell sound? (https://forums.alliedmods.net/showthread.php?t=342786)

Comlog 05-15-2023 08:05

CSGO What's the plugin for hs bell sound?
 
Hey im looking for the plugin hs bell/ding sound when you shoot someone in the head a bell/ding sound plays

oqyh 05-15-2023 15:24

Re: CSGO What's the plugin for hs bell sound?
 
Quote:

Originally Posted by Comlog (Post 2804410)
Hey im looking for the plugin hs bell/ding sound when you shoot someone in the head a bell/ding sound plays

https://github.com/oqyh/Plugins-Made...ound%20(1.0.3)

asdfxD 05-16-2023 08:49

Re: CSGO What's the plugin for hs bell sound?
 
doesnt play anything.

oqyh 05-16-2023 19:12

Re: CSGO What's the plugin for hs bell sound?
 
Quote:

Originally Posted by asdfxD (Post 2804429)
doesnt play anything.

increase volume
hs_sound_volume 1.00

oqyh 05-21-2023 01:14

Re: CSGO What's the plugin for hs bell sound?
 
Quote:

Originally Posted by asdfxD (Post 2804429)
doesnt play anything.

fixed
https://github.com/oqyh/Plugins-Made...ound%20(1.0.3)

Comlog 05-22-2023 07:48

Re: CSGO What's the plugin for hs bell sound?
 
Quote:

Originally Posted by oqyh (Post 2804741)

How can i make it play the sound for the attacker only in every hs, not only after kill

oqyh 05-22-2023 08:28

Re: CSGO What's the plugin for hs bell sound?
 
Quote:

Originally Posted by Comlog (Post 2804817)
How can i make it play the sound for the attacker only in every hs, not only after kill

change hs_sound_enable to 2

not tested

PHP Code:


#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>

#define PLUGIN_VERSION    "1.0.2"

ConVar Sound;
ConVar Soundvolume;

int bSound 0;
float bSoundvolume 0.00;

Handle SoundPath        INVALID_HANDLE;

public 
Plugin myinfo 
{
    
name "[ANY] Headshot Sound",
    
author "Gold KingZ",
    
description "Headshot Kill Sound",
    
version     PLUGIN_VERSION,
    
url "https://github.com/oqyh"
}

public 
void OnPluginStart()
{
    
CreateConVar("hs_sound_version"PLUGIN_VERSION"[ANY] Headshot Sound Plugin Version"FCVAR_NOTIFY|FCVAR_DONTRECORD);
    
    
Sound        =    CreateConVar"hs_sound_enable",     "1",    "Enable HeadShot Sound? || 2= Yes After Every Headshot || 1= Yes After Kill || 0= No"_true0.0true2.0);
    
Soundvolume        =    CreateConVar"hs_sound_volume",     "0.30",    "Volume of the Sound From 0.00 To 1.00 || 1.00 is the hightest"_true0.00true1.00);
    
SoundPath    =    CreateConVar"hs_sound_file",    "training/bell_normal.wav","if hs_sound_enable 1 or 2 Where is Sound Location Without Sound/ beginning" );
    
    
HookEvent("player_death"Event_PlayerDeath_PreEventHookMode_Pre);
    
HookEvent("player_hurt"Event_PlayerHurt_PreEventHookMode_Pre);
    
    
HookConVarChange(SoundOnSettingsChanged);
    
HookConVarChange(SoundvolumeOnSettingsChanged);
    
    
AutoExecConfig(true"Headshot_Sound");
}

public 
void OnConfigsExecuted()
{
    
bSound GetConVarInt(Sound);
    
bSoundvolume GetConVarFloat(Soundvolume);
    
    if(
GetConVarInt(Sound) == || GetConVarInt(Sound) == 2)
    {
        
char iFileSound[PLATFORM_MAX_PATH];
        
GetConVarString(SoundPathiFileSoundsizeof(iFileSound));
        if(!
StrEqual(iFileSound""))
        {
            
char download[PLATFORM_MAX_PATH];
            
Format(downloadsizeof(download), "sound/%s"iFileSound);
            
AddFileToDownloadsTable(download);
            
PrecacheSound(iFileSound);
        }
    }
    
}

public 
int OnSettingsChanged(Handle convar, const char[] oldValue, const char[] newValue)
{
    if(
convar == Sound)
    {
        
bSound Sound.IntValue;
    }
    
    if(
convar == Soundvolume)
    {
        
bSoundvolume Soundvolume.FloatValue;
    }
    
    return 
0;
}

public 
Action Event_PlayerDeath_Pre(Event event, const char[] namebool dontBroadcast)
{
    if(
bSound != 1)return Plugin_Continue;
    
    
int attacker GetClientOfUserId(event.GetInt("attacker"));
    
bool headshot GetEventBool(event"headshot");
    
    
char iFileSound[PLATFORM_MAX_PATH];
    
GetConVarString(SoundPathiFileSoundsizeof(iFileSound));
    
    if(
IsValidClient(attacker))
    {
        if(
headshot)
        {
            
EmitSoundToClient(attackeriFileSound____bSoundvolume);
        }
    }
    return 
Plugin_Continue;
}

public 
Action Event_PlayerHurt_Pre(Event event, const char[] namebool dontBroadcast)
{
    if(
bSound != 2)return Plugin_Continue;
    
    
int attacker GetClientOfUserId(event.GetInt("attacker"));
    
bool headshot GetEventBool(event"headshot");
    
    
char iFileSound[PLATFORM_MAX_PATH];
    
GetConVarString(SoundPathiFileSoundsizeof(iFileSound));
    
    if(
IsValidClient(attacker))
    {
        if(
headshot)
        {
            
EmitSoundToClient(attackeriFileSound____bSoundvolume);
        }
    }
    return 
Plugin_Continue;
}

stock bool IsValidClient(int iClient)
{
    return (
<= iClient <= MaxClients && IsClientInGame(iClient)) ? true false;



Comlog 05-22-2023 10:11

Re: CSGO What's the plugin for hs bell sound?
 
[QUOTE=oqyh;2804818]change hs_sound_enable to 2

not tested

it didnt work. Can you help me play the sound in every hs?

oqyh 05-23-2023 06:36

Re: CSGO What's the plugin for hs bell sound?
 
[QUOTE=Comlog;2804821]
Quote:

Originally Posted by oqyh (Post 2804818)
change hs_sound_enable to 2

not tested

it didnt work. Can you help me play the sound in every hs?

check last update

https://github.com/oqyh/Plugins-Made...ound%20(1.0.3)

Comlog 05-25-2023 10:32

Re: CSGO What's the plugin for hs bell sound?
 
[QUOTE=oqyh;2804861]
Quote:

Originally Posted by Comlog (Post 2804821)


Its still not working, Sound plays after hs only. i changed "hs_sound_enable", "2" but not working


All times are GMT -4. The time now is 08:11.

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