I stumbled across a little problem and i have no idea how to fix it.
I want to create a memory hack, let's say godmode and unlimited ammo.
I would do something like this:
Code:
void keys()
{
while(1){
if(GetAsyncKeyState(VK_F1)){
god =! god;
godMode();
Sleep(300);
}else if(GetAsyncKeyState(VKF2)){
ammo =! ammo;
unlAmmo();
Sleep(300);
}
}
}
void godMode()
{
while(god){
WriteProcessMemory(proc,(LPVOID)address,&health,sizeof(health),NULL);
}
}
void unlAmmo()
{
while(ammo){
WriteProcessMemory(proc,(LPVOID)address,&uammo,sizeof(uammo),NULL);
}
}
My problem is that i can't run multiple while loop at once, so the whole code is a bunch of garbage. Could someone please give me a hint what to do instead?