AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Round start sound for CS:GO (https://forums.alliedmods.net/showthread.php?t=342150)

gamer1 03-11-2023 18:47

Round start sound for CS:GO
 
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!

Grey83 03-12-2023 07:40

Re: Round start sound for CS:GO
 
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]);



gamer1 03-12-2023 10:41

Re: Round start sound for CS:GO
 
Quote:

Originally Posted by Grey83 (Post 2801091)
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 дуже дякую


All times are GMT -4. The time now is 17:55.

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