Code:
void triggerbottoggle()
{
while (true)
{
if (GetAsyncKeyState(VK_MENU) & 0x8000)
{
notfireTrigger = !notfireTrigger;
}
}
}
Why? If you want to toggle like this, use if (GetAsyncKeyState(VK_MENU) & 0x1) and add a Sleep in the Loop.
Code:
void triggerbottoggle()
{
while (true)
{
if (GetAsyncKeyState(VK_MENU) & 0x1)
{
notfireTrigger = !notfireTrigger;
Sleep(250);
}
}
}
Toggle == Press a key to activate, and it will shoot automatically when you aim at an enemy, if you want to hold down a button and let the game shoot only when the button is held down, do something like this
Code:
void trigger()
{
while(true)
{
DWORD LocalBase = Mem.Read<DWORD>(ClientDll + LocalPlayer);
int localTeam = Mem.Read<int>(LocalBase + Team);
if(notfireTrigger == true)
{
int enemyId = Mem.Read<int>(LocalBase + CrosshairID);
int enemyAdress = Mem.Read<int>(ClientDll + EntityList + ((enemyId - 1) * 0x10));
int enemyTeam = Mem.Read<int>(enemyAdress + Team);
int enemyHealth = Mem.Read<int>(enemyAdress + m_iHealth);
if(localTeam != enemyTeam && enemyHealth > 0 && GetAsyncKeyState(KeyToHoldDown) & 0x8000)
{
mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
}
}
Sleep(1);
}
}
Change KeyToHoldDown to your key.