/**
История изменений:
1.0.0b (07.07.2026) by b0t.
- Тестовый релиз;
*/
new const VERSION[] = "1.0.0b"
#include <amxmodx>
#include <reapi>
#define START_GROUP (1 << (0 & 31))
new const g_szStepsSound[][] = {
"player/pl_step1.wav",
"player/pl_step2.wav",
"player/pl_step3.wav",
"player/pl_step4.wav"
};
public plugin_init() {
register_plugin("Sounds groupinfo",VERSION,"b0t.");
RegisterHookChain(RH_SV_StartSound,"SV_StartSound_Pre", .post = false);
}
public SV_StartSound_Pre(const recipients, const pHost, const channel, const sample[], const volume, Float:attenuation, const fFlags, const pitch) {
if(~get_entvar(pHost,var_groupinfo) & START_GROUP) {
new iBitGroupHost = get_entvar(pHost,var_groupinfo);
for(new id=1;id<=MaxClients;++id) {
if(!is_user_connected(id) || is_user_bot(id) || is_user_hltv(id)) {
continue;
}
if(get_entvar(id,var_groupinfo) & iBitGroupHost) {
if(SoundIsStep(sample) && pHost == id) {
continue;
}
rh_emit_sound2(pHost,id,channel,sample,VOL_NORM,attenuation,fFlags,pitch);
}
}
return HC_SUPERCEDE;
}
if(get_entvar(pHost,var_groupinfo) & START_GROUP) {
for(new id=1;id<=MaxClients;++id) {
if(!is_user_connected(id) || is_user_bot(id) || is_user_hltv(id)) {
continue;
}
if(get_entvar(id,var_groupinfo) & START_GROUP) {
if(SoundIsStep(sample) && pHost == id) {
continue;
}
rh_emit_sound2(pHost,id,channel,sample,VOL_NORM,attenuation,fFlags,pitch);
}
}
return HC_SUPERCEDE;
}
return HC_CONTINUE;
}
stock bool:SoundIsStep(const szSound[]) {
for(new i;i<=charsmax(g_szStepsSound);++i) {
if(strcmp(szSound,g_szStepsSound[i]) == 0) {
return true;
}
}
return false;
}