For example weapons, player moves, +use soundSnake17, какие конкретно звуки? Шаги?
#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;
}
#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 blocklink
Код:#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; }
Did not work.This should block "+use" sound.Код:#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; }
if(iEntity == iRecipients)
return HC_CONTINUE;
return HC_SUPERCEDE
#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;
}