PDA

View Full Version : [Request] C4 Bomb Sound


andrew2kRO
01-30-2021, 07:12
I want a plugin when plant the bomb, to emit a sound, i searched but i didnt found any work plugin.

Drixevel
01-30-2021, 07:29
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>

public Plugin myinfo =
{
name = "[CSGO] Plant Sound",
author = "Drixevel",
description = "Plays a specific sound file whenever the bomb is planted.",
version = "1.0.0",
url = "https://github.com/drixevel"
};

public void OnPluginStart()
{
HookEvent("bomb_planted", Event_OnBombPlanted);
}

public void OnMapStart()
{
PrecacheSound("mysound/file.wav");
AddFileToDownloadsTable("sound/mysound/file.wav");
}

public void Event_OnBombPlanted(Event event, const char[] name, bool dontBroadcast)
{
EmitSoundToAll("mysound/file.wav");
}

andrew2kRO
01-30-2021, 16:33
Thank you very muuch!!! :D

andrew2kRO
01-31-2021, 05:01
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>

public Plugin myinfo =
{
name = "[CSGO] Plant Sound",
author = "Drixevel",
description = "Plays a specific sound file whenever the bomb is planted.",
version = "1.0.0",
url = "https://github.com/drixevel"
};
it works for one round, next round dosent work...
public void OnPluginStart()
{
HookEvent("bomb_planted", Event_OnBombPlanted);
}

public void OnMapStart()
{
PrecacheSound("mysound/file.wav");
AddFileToDownloadsTable("sound/mysound/file.wav");
}

public void Event_OnBombPlanted(Event event, const char[] name, bool dontBroadcast)
{
EmitSoundToAll("mysound/file.wav");
}

andrew2kRO
01-31-2021, 05:02
it worked a round, but next map dosent work

Bacardi
01-31-2021, 13:11
...when it stop working, do you see any red console errors, in game console ?

*edit
And game is CS:GO ? Right ?

andrew2kRO
02-02-2021, 10:12
...when it stop working, do you see any red console errors, in game console ?

*edit
And game is CS:GO ? Right ?

Yea, its csgo, and i dont have any error in console.

andrew2kRO
02-10-2021, 13:36
I fix that, i make another EmitSoundAny function :D