-
Автор темы
- #1
Код:
void __stdcall hooks::EmitSound::hook(IRecipientFilter& filter, int iEntIndex, int iChannel, const char* pSoundEntry, unsigned int nSoundEntryHash, const char* pSample, float flVolume, int nSeed, float flAttenuation, int iFlags, int iPitch, const Vector* pOrigin, const Vector* pDirection, void* pUtlVecOrigins, bool bUpdatePositions, float soundtime, int speakerentity, int unk) noexcept
{
if (g_cfg.misc.autoaccept) {
if (!strcmp(pSoundEntry, "UIPanorama.popup_accept_match_beep")) {
static auto fnAccept = reinterpret_cast<bool(__stdcall*)(const char*)>(util::PatternScan("client.dll", "55 8B EC 83 E4 F8 8B 4D 08 BA ? ? ? ? E8 ? ? ? ? 85 C0 75 12"));
static HWND window = FindWindow(NULL,"Counter-Strike: Global Offensive");
if (fnAccept) {
fnAccept("");
FLASHWINFO fi;
fi.cbSize = sizeof(FLASHWINFO);
fi.hwnd = window;
fi.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG;
fi.uCount = 0;
fi.dwTimeout = 0;
FlashWindowEx(&fi);
}
}
}
o_emitsound(m_enginesound(), filter, iEntIndex, iChannel, pSoundEntry, nSoundEntryHash, pSample, flVolume, nSeed, flAttenuation, iFlags, iPitch, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity, unk);
}