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

When bomb is planted play a sound.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
andrew2kRO
Junior Member
Join Date: Jun 2020
Location: 127.0.0.1
Old 06-06-2020 , 15:32   When bomb is planted play a sound.
Reply With Quote #1

Hello guys! I'm new in this community, and i want to request a plugin
that's when someone plants the bomb to hear a sound. Please, i've been looking for him for a long time.
andrew2kRO is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 06-06-2020 , 15:50   Re: When bomb is planted play a sound.
Reply With Quote #2

Code:
#pragma semicolon 1

#include <sourcemod>
#include <emitsoundany>
#pragma newdecls required

public Plugin myinfo = 
{
	name = "Bomb Plant Sound", 
	author = "Drixevel", 
	description = "Simply plays a sound whenever the bomb is planted.", 
	version = "1.0.0", 
	url = "https://drixevel.dev/"
};

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

public void OnMapStart()
{
	//Precache the sound file for use.
	PrecacheSoundAny("sourcemod/mymod/bacon.mp3");
	
	//Make sure the file is downloaded to clients.
	AddFileToDownloadsTable("sound/sourcemod/mymod/bacon.mp3");
}

public void Event_OnBombPlanted(Event event, const char[] name, bool dontBroadcast)
{
	//Play the sound whenever the 'bomb_planted' event fires.
	EmitSoundToAllAny("sourcemod/mymod/bacon.mp3"); 
}
Requires this include: https://forums.alliedmods.net/showthread.php?t=237045

Just update the paths and it should work for the file you want specifically.
Drixevel is offline
andrew2kRO
Junior Member
Join Date: Jun 2020
Location: 127.0.0.1
Old 06-06-2020 , 16:13   Re: When bomb is planted play a sound.
Reply With Quote #3

Thank you bro, but do you know how i can fix this error? missing map maps missing?
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 17:34.


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