CS:Source Block Round Start Sounds Help

martink1337

Участник
Сообщения
4
Реакции
1
Hello everyone!
There are a lot of plugins out there which blocks round end sounds and instead plays custom one sounds, the round end sound 'counter-terrorist win, etc' - not working with the plugins which is what i want but for round start. In every round beggining you can hear "okletsgo" and all other sounds, I tried a lot of methods - nothing actually works :/, tried with StopSound, Hook - still 0 results. I'll be glad if someone here knows and can help.
 
Решение
Hello everyone!
There are a lot of plugins out there which blocks round end sounds and instead plays custom one sounds, the round end sound 'counter-terrorist win, etc' - not working with the plugins which is what i want but for round start. In every round beggining you can hear "okletsgo" and all other sounds, I tried a lot of methods - nothing actually works :/, tried with StopSound, Hook - still 0 results. I'll be glad if someone here knows and can help.
hi, try this, unfortunately there is no source code.

XDSTYLE

Участник
Сообщения
410
Реакции
283
Hello everyone!
There are a lot of plugins out there which blocks round end sounds and instead plays custom one sounds, the round end sound 'counter-terrorist win, etc' - not working with the plugins which is what i want but for round start. In every round beggining you can hear "okletsgo" and all other sounds, I tried a lot of methods - nothing actually works :/, tried with StopSound, Hook - still 0 results. I'll be glad if someone here knows and can help.
hi, try this, unfortunately there is no source code.
 

Вложения

  • blockstartround.smx
    4.6 КБ · Просмотры: 6
Решение

Grey83

не пишу плагины с весны 2022
Сообщения
8,552
Реакции
5,029
@Nekro, вроде нет, но я делал исправления только для того, чтобы декомпиленый код смог скомпилиться
 

martink1337

Участник
Сообщения
4
Реакции
1
Yes! I just saw that someone answer me in the allied forum :), I think the code there is little bit more structured.
Сообщения автоматически склеены:

I tested the decompiled code and unfortunately it is not working, only the provided .smx from xdstyle is working for some reason :/
Сообщения автоматически склеены:

Yes! I just saw that someone answer me in the allied forum :), I think the code there is little bit more structured.
Сообщения автоматически склеены:


I tested the decompiled code and unfortunately it is not working, only the provided .smx from xdstyle is working for some reason :/
no errors, compiling the script even loads but sounds are played, with the .smx file from xdstyle - works, no sound are played.
 
Последнее редактирование:

martink1337

Участник
Сообщения
4
Реакции
1
hi, try this, unfortunately there is no source code.
@XDSTYLE , here source code of better version which works.


antiroundstart:
#include <sdktools>

float fTimestamp;

public void OnPluginStart()
{
    HookUserMessage(GetUserMessageId("SendAudio"), SendAudio, true);
    HookEvent("round_freeze_end", round_freeze_end, EventHookMode_PostNoCopy);
    HookEvent("round_end", round_end, EventHookMode_Pre);
}

public void round_freeze_end(Event event, const char[] name, bool dontBroadcast)
{
    fTimestamp = GetGameTime();
}

public Action round_end(Event event, const char[] name, bool dontBroadcast)
{
    if(!dontBroadcast)    // false, when this server event is also Fired on clients game. Return Plugin_Handled prevent Fire event on clients.
        return Plugin_Handled;

    return Plugin_Continue;
}

public Action SendAudio(UserMsg msg_id, BfRead msg, const int[] players, int playersNum, bool reliable, bool init)
{
    if(!reliable)
        return Plugin_Continue;

    if( (GetGameTime() - fTimestamp) != 0.00 )
        return Plugin_Continue;

    return Plugin_Handled;
}
 
Сверху Снизу