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

Round start sound for CS:GO


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gamer1
Junior Member
Join Date: Mar 2023
Old 03-11-2023 , 18:47   Round start sound for CS:GO
Reply With Quote #1

When the round starts, play an mp3 clip.

(The other plugins I found for this are currently not working.)

I was hoping someone has something?

I found this code too but I'm not sure if it's correct:

////////////////////////////////


#include <sourcemod>
#include <sdktools>

#pragma semicolon 1


public OnPluginStart()
{
HookEvent("round_poststart", Event_Round_PostStart);

if (GameRules_GetProp("m_bWarmupPeriod"))
return Plugin_Continue;

}
public OnMapStart()
{
PrecacheSound("quake/prepare.mp3");
AddFileToDownloadsTable("sound/quake/prepare.mp3");
}


public Action Event_Round_PostStart(Handle:event, const String:name[], bool:dontBroadcast)
{
EmitSoundToAll("quake/prepare.mp3");
}


/////////////////////
pls help guys, thanks!
gamer1 is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 03-12-2023 , 07:40   Re: Round start sound for CS:GO
Reply With Quote #2

maybe in this way?
PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sdktools_gamerules>
#include <sdktools_sound>
#include <sdktools_stringtables>

static const char
    SND
[]    = "sound/quake/prepare.mp3";

public 
void OnPluginStart()
{
    
HookEvent("round_freeze_end"Event_Round);
}

public 
void OnMapStart()
{
    
PrecacheSound(SND[6]);
    
AddFileToDownloadsTable(SND);
}

public 
void Event_Round(Event event, const char[] namebool dontBroadcast)
{
    if(!
GameRules_GetProp("m_bWarmupPeriod")) EmitSoundToAll(SND[6]);

__________________
Grey83 is offline
gamer1
Junior Member
Join Date: Mar 2023
Old 03-12-2023 , 10:41   Re: Round start sound for CS:GO
Reply With Quote #3

Quote:
Originally Posted by Grey83 View Post
maybe in this way?
PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sdktools_gamerules>
#include <sdktools_sound>
#include <sdktools_stringtables>

static const char
    SND
[]    = "sound/quake/prepare.mp3";

public 
void OnPluginStart()
{
    
HookEvent("round_freeze_end"Event_Round);
}

public 
void OnMapStart()
{
    
PrecacheSound(SND[6]);
    
AddFileToDownloadsTable(SND);
}

public 
void Event_Round(Event event, const char[] namebool dontBroadcast)
{
    if(!
GameRules_GetProp("m_bWarmupPeriod")) EmitSoundToAll(SND[6]);

Works like a charm, thanks @Grey83 дуже дякую
gamer1 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:14.


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