when i press F1 i want it to toggle a value to 1, then when that key is pressed again i want it to change the value to 0 and so on and so on as much as the user wants to switch between 1 and 0.
God is a boolean with no starting value when it was declaired. ive been trying to figure it out myself for the past 45 minutes or so without luck(my excuse is this is my first time opening visual studio in about a yearish )
Code:
if (GetAsyncKeyState(VK_F1) & 0x0001){
(ReadProcessMemory(hProcess,(void*)Gadr,&God,sizeof(Points),0));
if (God = 0){
God = 1;
(WriteProcessMemory(hProcess, (LPVOID)Gadr, &God, sizeof(Points), NULL));
cout << "God Mode ON" <<endl;
(ReadProcessMemory(hProcess,(void*)Gadr,&God,sizeof(Points),0));
cout << God <<endl;
}
else{
if (God = 1){
God = 0;
(WriteProcessMemory(hProcess, (LPVOID)Gadr, &God, sizeof(Points), NULL));
cout << "God Mode OFF" <<endl;
}
}
}