[CS:GO] SM STOPMUSIC MAPS

antonnn598

Участник
Сообщения
152
Реакции
9
Это как? Не пойму, о каких звуках идёт речь. Не помогает выключение командой или это про "хочу полностью отключать все звуки карты всем и сразу"?На доли секунды? Ещё быстрее не блокируется таким способом, надо что-то ещё более быстрое делать. Оффтоп
А вот просто снести звуки карты - самое быстрое дело.

Смотрите: на одной карте включается долгая музыка один раз (т.е. плагин вырубает музыку с начала раунда, и все тихо, позже она не включается), а на некоторых картах (типа mg) музыка включается сама (даже после отключения командой) Предложенный вами плагин отключает музыку в начале раунда, поэтому на таких mg-картах он бессилен.

Добавлено через 1 минуту
А вот просто снести звуки карты - самое быстрое дело.

Чтобы их снести, нужно декомпилировать карту?
 
Последнее редактирование:

AlmazON

Не путать с самим yand3xmail
Сообщения
5,099
Реакции
2,755

antonnn598

Участник
Сообщения
152
Реакции
9
Yura7181 получше объяснил.
Объединил версии плагинов в Stop Map Music v1.1.1, может поможет.Лучше всего, но не обязательно.

Так лучше, но ненамного. Где-то плагин слишком рано улавливает музыку, и поэтому не отключает её, а где-то вообще не отключает(Опять те же мг карты)
 

denis.kobzev.rzn

Участник
Сообщения
4
Реакции
0
@AlmazON, а можешь еще этот плагин поправить?
тут все прекрасно работает, кроме остановки музыки.
 

Вложения

  • stopsound.sp
    8.6 КБ · Просмотры: 46

BaFeR

Добрый человек
Сообщения
721
Реакции
216
Есть плагин, командой !stopmusic отключает всю музыка карту навсегда,то есть пока не включишь.
Только 1 -,нету исходника и не знаю где его найти.
 

Вложения

  • StopMusic.smx
    7.7 КБ · Просмотры: 123

Ozhent#.

Участник
Сообщения
44
Реакции
7
Чем они отличаются?
Нужна та которая ПРИНУДИТЕЛЬНО отключает музыку с карт (без команд).
 

Drumanid

Нестандартное звание
Сообщения
1,862
Реакции
1,748
Есть плагин, командой !stopmusic отключает всю музыка карту навсегда,то есть пока не включишь.
Только 1 -,нету исходника и не знаю где его найти.

Можно исходник ?

Блин, написано же, что исходника нет:dntknw:

PHP:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <csgo_colors>

#define PLUGIN_NAME     "Stop Map Music"
#define PLUGIN_VERSION     "1.0.0"

#define MAX_EDICTS        2048

new Float:g_fCmdTime[MAXPLAYERS+1];
new g_iSoundEnts[MAX_EDICTS];
new g_iNumSounds;
new bool:disabled[MAXPLAYERS + 1];

public Plugin:myinfo =
{
    name = PLUGIN_NAME,
    author = "GoD-Tony [Fixed by The Count]",
    description = "Allows clients to stop ambient sounds played by the map",
    version = PLUGIN_VERSION,
    url = "http://www.sourcemod.net/"
};

public OnPluginStart()
{
    CreateConVar("sm_stopmusic_version", PLUGIN_VERSION, "Stop Map Music", FCVAR_PLUGIN|FCVAR_NOTIFY|FCVAR_DONTRECORD);
   
    HookEvent("round_start", Event_RoundStart, EventHookMode_PostNoCopy);
   
    RegConsoleCmd("sm_stopmusic", Command_StopMusic, "Toggles map music");
   
    CreateTimer(10.0, Post_Start, _, TIMER_REPEAT);
}

public OnClientDisconnect_Post(client)
{
    g_fCmdTime[client] = 0.0;
    disabled[client] = false;
}

public Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    g_iNumSounds = 0;
   
    UpdateSounds();
    CreateTimer(0.8, Post_Start);
}

public OnEntityCreated(entity, const String:classname[]){
    if(!StrEqual(classname, "ambient_generic", false)){
        return;
    }
    new String:sSound[PLATFORM_MAX_PATH];
    GetEntPropString(entity, Prop_Data, "m_iszSound", sSound, sizeof(sSound));   
    new len = strlen(sSound);
    if (len > 4 && (StrEqual(sSound[len-3], "mp3") || StrEqual(sSound[len-3], "wav"))){
        g_iSoundEnts[g_iNumSounds++] = EntIndexToEntRef(entity);
    }else{
        return;
    }
    new ent = -1;
    for(new i=1;i<=MaxClients;i++){
        if(!disabled[i] || !IsClientInGame(i)){ continue; }
        for (new u=0; u<g_iNumSounds; u++){
            ent = EntRefToEntIndex(g_iSoundEnts[u]);
            if (ent != INVALID_ENT_REFERENCE){
                GetEntPropString(ent, Prop_Data, "m_iszSound", sSound, sizeof(sSound));
                Client_StopSound(i, ent, SNDCHAN_STATIC, sSound);
            }
        }
    }
}

UpdateSounds(){
    new String:sSound[PLATFORM_MAX_PATH];
    new entity = INVALID_ENT_REFERENCE;
    while ((entity = FindEntityByClassname(entity, "ambient_generic")) != INVALID_ENT_REFERENCE)
    {
        GetEntPropString(entity, Prop_Data, "m_iszSound", sSound, sizeof(sSound));
       
        new len = strlen(sSound);
        if (len > 4 && (StrEqual(sSound[len-3], "mp3") || StrEqual(sSound[len-3], "wav")))
        {
            g_iSoundEnts[g_iNumSounds++] = EntIndexToEntRef(entity);
        }
    }
}

public Action:Post_Start(Handle:timer){
    if(GetClientCount() <= 0){
        return Plugin_Continue;
    }
    new String:sSound[PLATFORM_MAX_PATH];
    new entity = INVALID_ENT_REFERENCE;
    for(new i=1;i<=MaxClients;i++){
        if(!disabled[i] || !IsClientInGame(i)){ continue; }
        for (new u=0; u<g_iNumSounds; u++){
            entity = EntRefToEntIndex(g_iSoundEnts[u]);
            if (entity != INVALID_ENT_REFERENCE){
                GetEntPropString(entity, Prop_Data, "m_iszSound", sSound, sizeof(sSound));
                Client_StopSound(i, entity, SNDCHAN_STATIC, sSound);
            }
        }
    }
    return Plugin_Continue;
}

public Action:Command_StopMusic(client, args)
{
    if (!client || g_fCmdTime[client] > GetGameTime())
        return Plugin_Handled;
   
    if(disabled[client]){
        disabled[client] = false;
        CGOPrintToChat(client, "[{GREEN}СЕРВЕР{DEFAULT}]: {GREEN}Музыка {RED}на {GREEN}карте {RED}вкл...");
        return Plugin_Handled;
    }
   
    g_fCmdTime[client] = GetGameTime() + 5.0;
   
    CGOPrintToChat(client, "[{GREEN}СЕРВЕР{DEFAULT}]: {GREEN}Музыка {RED}на {GREEN}карте {RED}выкл...");
   
    new String:sSound[PLATFORM_MAX_PATH], entity;
   
    for (new i = 0; i < g_iNumSounds; i++)
    {
        entity = EntRefToEntIndex(g_iSoundEnts[i]);
       
        if (entity != INVALID_ENT_REFERENCE)
        {
            GetEntPropString(entity, Prop_Data, "m_iszSound", sSound, sizeof(sSound));
            Client_StopSound(client, entity, SNDCHAN_STATIC, sSound);
        }
    }
    disabled[client] = true;
    return Plugin_Handled;
}

stock Client_StopSound(client, entity, channel, const String:name[])
{
    EmitSoundToClient(client, name, entity, channel, SNDLEVEL_NONE, SND_STOP, 0.0, SNDPITCH_NORMAL, _, _, _, true);
}
 

Вложения

  • StopMusic.smx
    7.8 КБ · Просмотры: 175
  • StopMusic.sp
    4.1 КБ · Просмотры: 158

✪ FIVE STAR ✪

Участник
Сообщения
54
Реакции
88
PHP:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <csgo_colors>

#define PLUGIN_NAME     "Stop Map Music"
#define PLUGIN_VERSION     "1.0.0"

#define MAX_EDICTS        2048

new Float:g_fCmdTime[MAXPLAYERS+1];
new g_iSoundEnts[MAX_EDICTS];
new g_iNumSounds;
new bool:disabled[MAXPLAYERS + 1];

public Plugin:myinfo =
{
    name = PLUGIN_NAME,
    author = "GoD-Tony [Fixed by The Count]",
    description = "Allows clients to stop ambient sounds played by the map",
    version = PLUGIN_VERSION,
    url = "http://www.sourcemod.net/"
};

public OnPluginStart()
{
    CreateConVar("sm_stopmusic_version", PLUGIN_VERSION, "Stop Map Music", FCVAR_PLUGIN|FCVAR_NOTIFY|FCVAR_DONTRECORD);
  
    HookEvent("round_start", Event_RoundStart, EventHookMode_PostNoCopy);
  
    RegConsoleCmd("sm_stopmusic", Command_StopMusic, "Toggles map music");
  
    CreateTimer(10.0, Post_Start, _, TIMER_REPEAT);
}

public OnClientDisconnect_Post(client)
{
    g_fCmdTime[client] = 0.0;
    disabled[client] = false;
}

public Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    g_iNumSounds = 0;
  
    UpdateSounds();
    CreateTimer(0.8, Post_Start);
}

public OnEntityCreated(entity, const String:classname[]){
    if(!StrEqual(classname, "ambient_generic", false)){
        return;
    }
    new String:sSound[PLATFORM_MAX_PATH];
    GetEntPropString(entity, Prop_Data, "m_iszSound", sSound, sizeof(sSound));  
    new len = strlen(sSound);
    if (len > 4 && (StrEqual(sSound[len-3], "mp3") || StrEqual(sSound[len-3], "wav"))){
        g_iSoundEnts[g_iNumSounds++] = EntIndexToEntRef(entity);
    }else{
        return;
    }
    new ent = -1;
    for(new i=1;i<=MaxClients;i++){
        if(!disabled[i] || !IsClientInGame(i)){ continue; }
        for (new u=0; u<g_iNumSounds; u++){
            ent = EntRefToEntIndex(g_iSoundEnts[u]);
            if (ent != INVALID_ENT_REFERENCE){
                GetEntPropString(ent, Prop_Data, "m_iszSound", sSound, sizeof(sSound));
                Client_StopSound(i, ent, SNDCHAN_STATIC, sSound);
            }
        }
    }
}

UpdateSounds(){
    new String:sSound[PLATFORM_MAX_PATH];
    new entity = INVALID_ENT_REFERENCE;
    while ((entity = FindEntityByClassname(entity, "ambient_generic")) != INVALID_ENT_REFERENCE)
    {
        GetEntPropString(entity, Prop_Data, "m_iszSound", sSound, sizeof(sSound));
      
        new len = strlen(sSound);
        if (len > 4 && (StrEqual(sSound[len-3], "mp3") || StrEqual(sSound[len-3], "wav")))
        {
            g_iSoundEnts[g_iNumSounds++] = EntIndexToEntRef(entity);
        }
    }
}

public Action:Post_Start(Handle:timer){
    if(GetClientCount() <= 0){
        return Plugin_Continue;
    }
    new String:sSound[PLATFORM_MAX_PATH];
    new entity = INVALID_ENT_REFERENCE;
    for(new i=1;i<=MaxClients;i++){
        if(!disabled[i] || !IsClientInGame(i)){ continue; }
        for (new u=0; u<g_iNumSounds; u++){
            entity = EntRefToEntIndex(g_iSoundEnts[u]);
            if (entity != INVALID_ENT_REFERENCE){
                GetEntPropString(entity, Prop_Data, "m_iszSound", sSound, sizeof(sSound));
                Client_StopSound(i, entity, SNDCHAN_STATIC, sSound);
            }
        }
    }
    return Plugin_Continue;
}

public Action:Command_StopMusic(client, args)
{
    if (!client || g_fCmdTime[client] > GetGameTime())
        return Plugin_Handled;
  
    if(disabled[client]){
        disabled[client] = false;
        CGOPrintToChat(client, "[{GREEN}СЕРВЕР{DEFAULT}]: {GREEN}Музыка {RED}на {GREEN}карте {RED}вкл...");
        return Plugin_Handled;
    }
  
    g_fCmdTime[client] = GetGameTime() + 5.0;
  
    CGOPrintToChat(client, "[{GREEN}СЕРВЕР{DEFAULT}]: {GREEN}Музыка {RED}на {GREEN}карте {RED}выкл...");
  
    new String:sSound[PLATFORM_MAX_PATH], entity;
  
    for (new i = 0; i < g_iNumSounds; i++)
    {
        entity = EntRefToEntIndex(g_iSoundEnts[i]);
      
        if (entity != INVALID_ENT_REFERENCE)
        {
            GetEntPropString(entity, Prop_Data, "m_iszSound", sSound, sizeof(sSound));
            Client_StopSound(client, entity, SNDCHAN_STATIC, sSound);
        }
    }
    disabled[client] = true;
    return Plugin_Handled;
}

stock Client_StopSound(client, entity, channel, const String:name[])
{
    EmitSoundToClient(client, name, entity, channel, SNDLEVEL_NONE, SND_STOP, 0.0, SNDPITCH_NORMAL, _, _, _, true);
}
Не навсегда, в новом раунде вкл...
 

HellWaer

Участник
Сообщения
273
Реакции
32
Хоть один рабочий плагин для css есть? Как пример - bhop_challenjour_v2 нифига не отключает музыку карты.
 
Сверху Снизу