how to make my program pause and resume
Apr 29, 2014 at 9:54pm UTC
c++ what i am doing is making a autoprone program that when you shoot at someone in say call of duty you go prone while your shooting, im trying to make it so the user can pause it so it no longer makes them go prone when they press the shoot button. then be able to resume when they press the same button or another button such as F11
1 2 3 4 5 6 7 8 9 10 11 12
if (userkey == "start" ){
while (true ){
if (GetAsyncKeyState(VK_LBUTTON) & 0x0001)
{
keybd_event( VK_CONTROL,0x11,KEYEVENTF_EXTENDEDKEY | 0,0 );
keybd_event( VK_CONTROL,0x11,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,0);
cout << "Going prone " ;
}
if (GetAsyncKeyState(VK_F11) & 0x0001){
break ;
}
i changed it to a break but im not sure how to well break a break. how to continue
Last edited on Apr 30, 2014 at 7:39pm UTC
Apr 30, 2014 at 7:30pm UTC
any ideas people lol. i found no answers on google
Apr 30, 2014 at 9:04pm UTC
You don't really want to pause and resume. You want to toggle whether or not that piece is executed.
You could do something like:
1 2 3 4 5
bool proneToggle=true ;
if (/*F11 key is pressed*/ )
proneToggle = !proneToggle;
if (proneToggle)
//do stuff
May 1, 2014 at 3:06am UTC
i tried that but im not quite sure what to do where you said do stuff. i want to be able to toggle on and off multiple times of what i posted
Topic archived. No new replies allowed.