<commit_before>/**
 * vim: set ts=4 :
 * =============================================================================
 * in_game_audio_map_change
 * Plays a song to all clients just before the map ends so they can listen to
 * music while the next map loads.  Also triggers when the next map vote starts
 * when a RockTheVote is called.
 *
 * Copyright 2013 CrimsonTautology
 * =============================================================================
 *
 */


#pragma semicolon 1

#include <sourcemod>
#include <in_game_audio>

#define PLUGIN_VERSION "1.8.7"
#define PLUGIN_NAME "In Game Audio Map Change" 

public Plugin:myinfo =
{
    name = PLUGIN_NAME,
    author = "CrimsonTautology",
    description = "Play a song during map change",
    version = PLUGIN_VERSION,
    url = "https://github.com/CrimsonTautology/sm_in_game_audio"
};

public OnPluginStart()
{
    decl String:mod_name[PLATFORM_MAX_PATH];
    GetGameFolderName(mod_name, sizeof(mod_name));

    LoadTranslations("in_game_audio.phrases");

    CreateConVar("sm_iga_map_change_version", PLUGIN_VERSION, PLUGIN_NAME, FCVAR_PLUGIN | FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY | FCVAR_DONTRECORD);

    if(StrEqual(mod_name, "tf"))
    {
        HookEventEx("teamplay_game_over", Event_MapChange);
    }else if(StrEqual(mod_name, "dod"))
    {
        HookEventEx("dod_game_over", Event_MapChange);
    }else{
        HookEventEx("game_end", Event_MapChange);
    }
}

public Action:Event_MapChange(Handle:event, const String:name[], bool:dontBroadcast)
{
    //Prevent HTTP calls when noone is online
    if(!CanAnyoneHearIGA()) return Plugin_Continue;

    new String:next_map[64];
    GetNextMap(next_map, sizeof(next_map));
    MapTheme(true, next_map);

    return Plugin_Continue;
}<commit_msg>Block victory music from playing in fistful of frags<commit_after>/**
 * vim: set ts=4 :
 * =============================================================================
 * in_game_audio_map_change
 * Plays a song to all clients just before the map ends so they can listen to
 * music while the next map loads.  Also triggers when the next map vote starts
 * when a RockTheVote is called.
 *
 * Copyright 2013 CrimsonTautology
 * =============================================================================
 *
 */


#pragma semicolon 1

#include <sourcemod>
#include <in_game_audio>

#define PLUGIN_VERSION "1.8.7"
#define PLUGIN_NAME "In Game Audio Map Change" 

public Plugin:myinfo =
{
    name = PLUGIN_NAME,
    author = "CrimsonTautology",
    description = "Play a song during map change",
    version = PLUGIN_VERSION,
    url = "https://github.com/CrimsonTautology/sm_in_game_audio"
};

public OnPluginStart()
{
    decl String:mod_name[PLATFORM_MAX_PATH];
    GetGameFolderName(mod_name, sizeof(mod_name));

    LoadTranslations("in_game_audio.phrases");

    CreateConVar("sm_iga_map_change_version", PLUGIN_VERSION, PLUGIN_NAME, FCVAR_PLUGIN | FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY | FCVAR_DONTRECORD);

    if(StrEqual(mod_name, "tf"))
    {
        HookEventEx("teamplay_game_over", Event_MapChange);
    }else if(StrEqual(mod_name, "dod"))
    {
        HookEventEx("dod_game_over", Event_MapChange);
    }else if(StrEqual(mod_name, "dod"))
    {
        AddNormalSoundHook(FoFSoundCallback);
        HookEventEx("game_end", Event_MapChange);
    }else{
        HookEventEx("game_end", Event_MapChange);
    }

}

public Action:Event_MapChange(Handle:event, const String:name[], bool:dontBroadcast)
{
    //Prevent HTTP calls when noone is online
    if(!CanAnyoneHearIGA()) return Plugin_Continue;

    new String:next_map[64];
    GetNextMap(next_map, sizeof(next_map));
    MapTheme(true, next_map);

    return Plugin_Continue;
}

public Action:FoFSoundCallback(clients[64], &numClients, String:sample[PLATFORM_MAX_PATH], &entity, &channel, &Float:volume, &level, &pitch, &flags)
{
    //Block victory music at round end
    if(StrEqual(sample, "common/victory.mp3")) {
        return Plugin_Stop;
    }
    return Plugin_Continue;
}
{'fraction_non_alphanumeric': 0.17459138187221396, 'fraction_numerical': 0.006191183754333828, 'mean_word_length': 4.704802259887006, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2364468', 'n_tokens_mistral': 1352, 'n_tokens_neox': 1294, 'n_words': 290}