Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C++]On/Off on one hotkey not work :o (Solved)
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Zerith
Master Cheater
Reputation: 1

Joined: 07 Oct 2007
Posts: 468

PostPosted: Mon Dec 22, 2008 8:05 am    Post subject: Reply with quote

Wiw3K wrote:
yes take a look,

Code:
      if(GetAsyncKeyState(VK_F4)) //Hax On/Off
      {
         if (!HaxStatus)
      {
         HaxStatus = 0;
         *(WORD*)HAXORZ = 0x0000; //here i have modified one.
      }
         else
      {
     
         HaxStatus = 1;
         *(WORD*)HAXORZ = 0x0000; //Here Oryginal Bytes.
      }


i can check if this works adding MessageBoxes.

Code:
      if(GetAsyncKeyState(VK_F4)) //Hax On/Off
      {
         if (!HaxStatus)
      {
         HaxStatus = 0;
         *(WORD*)HAXORZ = 0x0000; //here i have modified one.
         MessageBoxA(0, "Hax On", "Hax", 0);
      }
         else
      {
     
         HaxStatus = 1;
         *(WORD*)HAXORZ = 0x0000; //Here Oryginal Bytes.
         MessageBoxA(0, "Hax Off", "Hax", 0);
      }

Wink


---edit---
this is dll how i can debug? xd


...
You set the global variable HaxStatus to 0.
When you first press F4, it will set HaxStatus to 0 AGAIN, making it forever going to the if statement.

And again, use the method Jani mentioned, not your inefficient one.
Back to top
View user's profile Send private message MSN Messenger
TraxMate
Master Cheater
Reputation: 0

Joined: 01 Mar 2008
Posts: 363

PostPosted: Mon Dec 22, 2008 9:29 am    Post subject: Reply with quote

Code:
BOOL On = FALSE;
for(;;)
{
   if(GetAsyncKeyState(VK_F4))
   {
      if(!On)
      {
         On = TRUE;
         MessageBox(hWnd, _T("Hax On"), _T("Hax"), MB_OK);
      }
      else
      {
         On = FALSE;
         MessageBox(hWnd, _T("Hax Off"), _T("Hax"), MB_OK);
      }
   }
   Sleep(100);
}
This is working fine for me so it should work for you too.
Back to top
View user's profile Send private message
Wiw3K
Grandmaster Cheater
Reputation: 0

Joined: 09 Jul 2006
Posts: 762
Location: Poland.

PostPosted: Mon Dec 22, 2008 10:07 am    Post subject: Reply with quote

TraxMate wrote:
Code:
BOOL On = FALSE;
for(;;)
{
   if(GetAsyncKeyState(VK_F4))
   {
      if(!On)
      {
         On = TRUE;
         MessageBox(hWnd, _T("Hax On"), _T("Hax"), MB_OK);
      }
      else
      {
         On = FALSE;
         MessageBox(hWnd, _T("Hax Off"), _T("Hax"), MB_OK);
      }
   }
   Sleep(100);
}
This is working fine for me so it should work for you too.

Yay works, ty you so much now i see how it works Smile
Back to top
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Mon Dec 22, 2008 10:37 am    Post subject: Reply with quote

Use to xor for activating the hack...

Code:

if(GetAsyncKeyState(VK_F1))
           *(WORD*)HAXORZ ^= 1;


Etc...
Back to top
View user's profile Send private message
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Mon Dec 22, 2008 11:32 am    Post subject: Reply with quote

Or do:
Code:
HAX = !HAX;
Back to top
View user's profile Send private message
ElJEffro
Grandmaster Cheater Supreme
Reputation: 0

Joined: 15 Apr 2007
Posts: 1881
Location: La Tierra

PostPosted: Sun Dec 28, 2008 8:06 pm    Post subject: Reply with quote

For future reference use DebugView + OutputDebugString instead of MessageBox
Debugview can be downloaded here
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites