Привет. У меня в коде две функции. Одна из них работает, а вторая - нет. Это зависит от расположения кода в int main().
Вот пример(работает glowESP):
Вот ещё один пример(работает triggerBot):
Вот пример(работает glowESP):
C++:
int main()
{
hwnd = FindWindowA(NULL, "Counter-Strike: Global Offensive");
GetWindowThreadProcessId(hwnd, &procId);
moduleBase = GetModuleBaseAddress("client.dll");
hProcess = OpenProcess(PROCESS_ALL_ACCESS, NULL, procId);
while (!GetAsyncKeyState(VK_END))
{
uintptr_t dwGlowManager = RPM<uintptr_t>(moduleBase + dwGlowObjectManager);
int LocalTeam = RPM<int>(getLocalPlayer() + m_iTeamNum);
for (int i = 1; i < 32; i++) {
uintptr_t dwEntity = RPM<uintptr_t>(moduleBase + dwEntityList + i * 0x10);
int iGlowIndx = RPM<int>(dwEntity + m_iGlowIndex);
int EnmHealth = RPM<int>(dwEntity + m_iHealth); if (EnmHealth < 1 || EnmHealth > 100) continue;
int Dormant = RPM<int>(dwEntity + m_bDormant); if (Dormant) continue;
int EntityTeam = RPM<int>(dwEntity + m_iTeamNum);
if (LocalTeam == EntityTeam)
{
WPM<glowStructLocal>(dwGlowManager + (iGlowIndx * 0x38) + 0x4, glowLocal);
}
else if (LocalTeam != EntityTeam)
{
WPM<glowStructEnemy>(dwGlowManager + (iGlowIndx * 0x38) + 0x4, glowEnm);
}
}
}
while (!GetAsyncKeyState(VK_END))
{
int CrosshairID = getCrosshairID(getLocalPlayer());
int CrosshairTeam = getTeam(getPlayer(CrosshairID - 1));
int LocalTeam = getTeam(getLocalPlayer());
if (CrosshairID > 0 && CrosshairID < 32 && LocalTeam != CrosshairTeam)
{
if (GetAsyncKeyState(VK_MENU /*alt key*/))
{
mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, 0, 0);
Sleep(100); //Optional
}
}
}
}
C++:
int main()
{
hwnd = FindWindowA(NULL, "Counter-Strike: Global Offensive");
GetWindowThreadProcessId(hwnd, &procId);
moduleBase = GetModuleBaseAddress("client.dll");
hProcess = OpenProcess(PROCESS_ALL_ACCESS, NULL, procId);
while (!GetAsyncKeyState(VK_END))
{
int CrosshairID = getCrosshairID(getLocalPlayer());
int CrosshairTeam = getTeam(getPlayer(CrosshairID - 1));
int LocalTeam = getTeam(getLocalPlayer());
if (CrosshairID > 0 && CrosshairID < 32 && LocalTeam != CrosshairTeam)
{
if (GetAsyncKeyState(VK_MENU /*alt key*/))
{
mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, 0, 0);
Sleep(100); //Optional
}
}
}
while (!GetAsyncKeyState(VK_END))
{
uintptr_t dwGlowManager = RPM<uintptr_t>(moduleBase + dwGlowObjectManager);
int LocalTeam = RPM<int>(getLocalPlayer() + m_iTeamNum);
for (int i = 1; i < 32; i++) {
uintptr_t dwEntity = RPM<uintptr_t>(moduleBase + dwEntityList + i * 0x10);
int iGlowIndx = RPM<int>(dwEntity + m_iGlowIndex);
int EnmHealth = RPM<int>(dwEntity + m_iHealth); if (EnmHealth < 1 || EnmHealth > 100) continue;
int Dormant = RPM<int>(dwEntity + m_bDormant); if (Dormant) continue;
int EntityTeam = RPM<int>(dwEntity + m_iTeamNum);
if (LocalTeam == EntityTeam)
{
WPM<glowStructLocal>(dwGlowManager + (iGlowIndx * 0x38) + 0x4, glowLocal);
}
else if (LocalTeam != EntityTeam)
{
WPM<glowStructEnemy>(dwGlowManager + (iGlowIndx * 0x38) + 0x4, glowEnm);
}
}
}
}