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

[Request] C4 Bomb Sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
andrew2kRO
Junior Member
Join Date: Jun 2020
Location: 127.0.0.1
Old 01-30-2021 , 07:12   [Request] C4 Bomb Sound
Reply With Quote #1

I want a plugin when plant the bomb, to emit a sound, i searched but i didnt found any work plugin.
andrew2kRO is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 01-30-2021 , 07:29   Re: [Request] C4 Bomb Sound
Reply With Quote #2

Code:
#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");
}

Last edited by Drixevel; 01-30-2021 at 07:29.
Drixevel is offline
andrew2kRO
Junior Member
Join Date: Jun 2020
Location: 127.0.0.1
Old 01-30-2021 , 16:33   Re: [Request] C4 Bomb Sound
Reply With Quote #3

Thank you very muuch!!!
andrew2kRO is offline
andrew2kRO
Junior Member
Join Date: Jun 2020
Location: 127.0.0.1
Old 01-31-2021 , 05:01   Re: [Request] C4 Bomb Sound
Reply With Quote #4

Quote:
Originally Posted by Drixevel View Post
Code:
#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 is offline
andrew2kRO
Junior Member
Join Date: Jun 2020
Location: 127.0.0.1
Old 01-31-2021 , 05:02   Re: [Request] C4 Bomb Sound
Reply With Quote #5

it worked a round, but next map dosent work
andrew2kRO is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 01-31-2021 , 13:11   Re: [Request] C4 Bomb Sound
Reply With Quote #6

...when it stop working, do you see any red console errors, in game console ?

*edit
And game is CS:GO ? Right ?

Last edited by Bacardi; 01-31-2021 at 13:12.
Bacardi is offline
andrew2kRO
Junior Member
Join Date: Jun 2020
Location: 127.0.0.1
Old 02-02-2021 , 10:12   Re: [Request] C4 Bomb Sound
Reply With Quote #7

Quote:
Originally Posted by Bacardi View Post
...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 is offline
andrew2kRO
Junior Member
Join Date: Jun 2020
Location: 127.0.0.1
Old 02-10-2021 , 13:36   Re: [Request] C4 Bomb Sound
Reply With Quote #8

I fix that, i make another EmitSoundAny function
andrew2kRO 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:50.


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