it does not want to work
Code:
Hooks.h
using PlaySoundFn = void(__stdcall*)(const char*);
extern PlaySoundFn oPlaySound;
using IsReadyFn = void(__cdecl*)();
namespace O
{
PlaySoundFn oPlaySound;
IsReadyFn IsReady;
}
Code:
DllMain.cpp
void __stdcall PlaySound_CSGO(const char* fileName)
{
HWND Window;
O::oPlaySound(fileName);
if (Interface.Engine->IsInGame() || !Options::Misc::AtutoAccept)
return;
//This is the beep sound that is played when we have found a game
if (!strcmp(fileName, "!UI/competitive_accept_beep.wav")) {
//This is the function that is called when you press the big ACCEPT button
O::IsReady = (IsReadyFn)((DWORD)FindSignature(XorStr("client.dll"), XorStr("IsReady"), XorStr("55 8B EC 83 E4 F8 83 EC 08 56 8B 35 ? ? ? ? 57 83 BE")));
//Accept the game
O::IsReady();
//This will flash the CSGO window on the taskbar
//so we know a game was found (you cant hear the beep sometimes cause it auto-accepts too fast)
FLASHWINFO fi;
fi.cbSize = sizeof(FLASHWINFO);
fi.hwnd = Window;
fi.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG;
fi.uCount = 0;
//Beep(100, 5);
fi.dwTimeout = 0;
FlashWindowEx(&fi);
}
}