Пользователь
- Сообщения
- 24
- Реакции
- 4
How disable ambient sounds with reapi?
#include <amxmodx>
#include <reapi>
#define PLUGIN "DisableAmbient"
#define VERSION "1.0"
#define AUTHOR "PANDA"
new HookChain: g_ambient;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(0.1, "offHook");
}
public plugin_precache() g_ambient=RegisterHookChain(RH_GetEntityInit, "sound", 1);
public offHook() DisableHookChain(g_ambient);
public sound(classname[]){
if(contain(classname, "ambient_generic")!=-1){
SetHookChainReturn(ATYPE_INTEGER, 0);
return HC_SUPERCEDE;
}
return HC_CONTINUE;
}