Поиск Block Sounds From Other Players

Сообщения
24
Реакции
0
Is it possible to block sounds that other players do? So i only hear my sounds. I will use this for my invis plugin. So i won't hear sounds of players which i made invisible for me
 
Сообщения
3,593
Реакции
1,576
Помог
141 раз(а)
Код:
#include <amxmodx>
#include <reapi>

public plugin_init()
{
    register_plugin("Block Use Sound", "1.0.0", "Nordic Warrior");
    
    RegisterHookChain(RH_SV_StartSound, "SV_StartSound_Pre");
}

public SV_StartSound_Pre(const iRecipients, const iEntity, const iChannel, const szSample[], const flVolume, Float:flAttenuation, const fFlags, const iPitch)
{
    if(!strcmp(szSample, "wpn_denyselect.wav"))
        return HC_SUPERCEDE;
}
This should block "+use" sound.
 
Сообщения
673
Реакции
242
Помог
11 раз(а)
link

Код:
#include <amxmodx>
#include <reapi>

public plugin_init()
{
    RegisterHookChain(RH_SV_StartSound, "SV_StartSound");
}

public SV_StartSound(const recipients, const entity, const channel, const sample[], const volume, Float:attenuation, const fFlags, const pitch)
{
    // check sample player/pl_XXXX.wav
    if (sample[0] != 'p' || sample[1] != 'l'
        || sample[7] != 'p' || sample[8] != 'l') {
        return HC_CONTINUE
    }

    if (entity == 2/*the specified player*/ && recipients == 1) {
        return HC_SUPERCEDE;
    }

    return HC_CONTINUE;
}
 
Сообщения
24
Реакции
0
link

Код:
#include <amxmodx>
#include <reapi>

public plugin_init()
{
    RegisterHookChain(RH_SV_StartSound, "SV_StartSound");
}

public SV_StartSound(const recipients, const entity, const channel, const sample[], const volume, Float:attenuation, const fFlags, const pitch)
{
    // check sample player/pl_XXXX.wav
    if (sample[0] != 'p' || sample[1] != 'l'
        || sample[7] != 'p' || sample[8] != 'l') {
        return HC_CONTINUE
    }

    if (entity == 2/*the specified player*/ && recipients == 1) {
        return HC_SUPERCEDE;
    }

    return HC_CONTINUE;
}
Thank you so much. This blocked player movement sounds but i need weapon sounds and +use sound to block
 
Сообщения
24
Реакции
0
Код:
#include <amxmodx>
#include <reapi>

public plugin_init()
{
    register_plugin("Block Use Sound", "1.0.0", "Nordic Warrior");
   
    RegisterHookChain(RH_SV_StartSound, "SV_StartSound_Pre");
}

public SV_StartSound_Pre(const iRecipients, const iEntity, const iChannel, const szSample[], const flVolume, Float:flAttenuation, const fFlags, const iPitch)
{
    if(!strcmp(szSample, "wpn_denyselect.wav"))
        return HC_SUPERCEDE;
}
This should block "+use" sound.
Did not work.
 
Сообщения
673
Реакции
242
Помог
11 раз(а)
Snake17, You can use this plugin, but you need to slightly change the plugin, in terms of sending

Ex.
Код:
if(iEntity == iRecipients)
    return HC_CONTINUE;
    
return HC_SUPERCEDE
Block WpnSelect Sound
 
Сообщения
855
Реакции
532
Помог
13 раз(а)
PHP:
#include <amxmodx>
#include <reapi>

public plugin_init()
{
    register_plugin("Block Use Sound", "1.0.0", "Nordic Warrior");
    
    RegisterHookChain(RH_SV_StartSound, "SV_StartSound_Pre");
}

public SV_StartSound_Pre(const iRecipients, const iEntity, const iChannel, const szSample[], const flVolume, Float:flAttenuation, const fFlags, const iPitch)
{
    if (!iRecipients)  // like a bool status that shows sound's emit in some radius.
        return HC_CONTINUE; // ignore it, it it's only target emit

    if (!is_user_alive(iEntity) || !IsUserInviser[iEntity]) // check for player & user invis status
        return HC_CONTINUE;

    return HC_SUPERCEDE;
}
 

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу