Go Back   UnKnoWnCheaTs - Multiplayer Game Hacks and Cheats > Anti-Cheat Software & Programming > Direct3D

- Sponsored Advertisement -
http://www.myfpscheats.com/

Welcome to the UnKnoWnCheaTs - Multiplayer Game Hacks and Cheats.
You have to register before you can post and see and access any of the advanced forum features, please click the register link to proceed to the registration form. To start viewing threads or posts, select a forum that you want to visit from the selection below.
Direct3D
hacking programming reversing
You are Unregistered, please register to gain Full access.    
Reply
 
Thread Tools

Button Menu Bug
Old 08-19-2010, 10:21 AM   #1
Member

acid_buRn's Avatar

Join Date: Dec 2009
Posts: 68
Reputation: 384
Rep Power: 31
acid_buRn has learned Kazaa is not a third world countryacid_buRn has learned Kazaa is not a third world countryacid_buRn has learned Kazaa is not a third world countryacid_buRn has learned Kazaa is not a third world country
Points: 1,965, Level: 3
Points: 1,965, Level: 3 Points: 1,965, Level: 3 Points: 1,965, Level: 3
Activity: 2.3%
Activity: 2.3% Activity: 2.3% Activity: 2.3%
Last Achievements
Button Menu Bug

Ive run into some trouble with my button menu.
It works and all, But when I click the button to activate the hack, It turn on, Then turns straight off again.

Here is the AddButton && RenderButton function:

Code:
void AddButton(int bnum, char *bcaption, int bx, int by, int bw, int bh )
{
     Button[bnum].num       = bnum;
     Button[bnum].caption   = bcaption;
     Button[bnum].x         = bx;
     Button[bnum].y         = by;
     Button[bnum].w         = bw;
     Button[bnum].h         = bh;
     Button[bnum].clicked   = false;
}

void RenderButton(int butnum)
{
     int mw = Button[butnum].x + Button[butnum].w;
     int mh = Button[butnum].y + Button[butnum].h;

	 //Defualt apperance
	 DrawBox(Button[butnum].x, Button[butnum].y,  Button[butnum].w,  Button[butnum].h, Black, Red,g_pDevice);
	 PrintText(pFont, Button[butnum].x + 15, Button[butnum].y + 3, White, Button[butnum].caption);

	 POINT cur;
     GetCursorPos( &cur );

	 //if the mouse coords are the same as the buttons coords
      if ( cur.x > Button[butnum].x &&  cur.x < mw && cur.y > Button[butnum].y && cur.y < mh )
	  {
		   DrawBox(Button[butnum].x, Button[butnum].y,  Button[butnum].w,  Button[butnum].h, Black, Blue, g_pDevice);
		   PrintText(pFont, Button[butnum].x + 15, Button[butnum].y + 3, White, Button[butnum].caption);

		  //if mouse button is clicked
		   if ( GetAsyncKeyState( VK_LBUTTON )&1) 
		   {
				Button[butnum].clicked = !Button[butnum].clicked;
			}
	  }

	  if ( Button[butnum].clicked )
	  {
		  DrawBox(Button[butnum].x, Button[butnum].y,  Button[butnum].w,  Button[butnum].h, Black, Green, g_pDevice);
		  PrintText(pFont, Button[butnum].x + 15, Button[butnum].y + 3, White, Button[butnum].caption);
	  }
}
And the usage of the button:

Code:
if ( Button[1].clicked ) 
		//HackOn
else
               //HackOff
Im really stuck here. And dont know whats wrong.
Help me please!!

Thanks,
acid
acid_buRn is offline

Reply With Quote


Old 08-19-2010, 10:26 AM   #2
UnKnoWnCheaTeR

Freeheadshot's Avatar

Join Date: Mar 2010
Location: Germany
Posts: 941
Reputation: 40621
Rep Power: 448
Freeheadshot has a huge epeen!Freeheadshot has a huge epeen!Freeheadshot has a huge epeen!Freeheadshot has a huge epeen!Freeheadshot has a huge epeen!Freeheadshot has a huge epeen!Freeheadshot has a huge epeen!Freeheadshot has a huge epeen!Freeheadshot has a huge epeen!Freeheadshot has a huge epeen!Freeheadshot has a huge epeen!
Recognitions:
The UC Member of the Month award is a prestigious award given to a single community member on a monthly basis. Based on a vote by UnKnoWnCheaTs staff, the award is given to the forum member that has shown exemplary achievement and potential in the UnKnoWnCheaTs community, and has shown great commitment to upholding the principles upon which UnKnoWnCheaTs stands for. A member who has been awarded the Member of the Month award has been distinguished as an asset to the UnKnoWnCheaTs community. Member of the Month
Points: 25,225, Level: 22
Points: 25,225, Level: 22 Points: 25,225, Level: 22 Points: 25,225, Level: 22
Activity: 14.1%
Activity: 14.1% Activity: 14.1% Activity: 14.1%
Last Achievements
Try this:
Code:
void AddButton(int bnum, char *bcaption, int bx, int by, int bw, int bh )
{
     Button[bnum].num       = bnum;
     Button[bnum].caption   = bcaption;
     Button[bnum].x         = bx;
     Button[bnum].y         = by;
     Button[bnum].w         = bw;
     Button[bnum].h         = bh;
     Button[bnum].clicked   = false;
}
#define KEY_DOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)
void RenderButton(int butnum)
{
     int mw = Button[butnum].x + Button[butnum].w;
     int mh = Button[butnum].y + Button[butnum].h;

	 //Defualt apperance
	 DrawBox(Button[butnum].x, Button[butnum].y,  Button[butnum].w,  Button[butnum].h, Black, Red,g_pDevice);
	 PrintText(pFont, Button[butnum].x + 15, Button[butnum].y + 3, White, Button[butnum].caption);

	 POINT cur;
     GetCursorPos( &cur );

	 //if the mouse coords are the same as the buttons coords
      if ( cur.x > Button[butnum].x &&  cur.x < mw && cur.y > Button[butnum].y && cur.y < mh )
	  {
		   DrawBox(Button[butnum].x, Button[butnum].y,  Button[butnum].w,  Button[butnum].h, Black, Blue, g_pDevice);
		   PrintText(pFont, Button[butnum].x + 15, Button[butnum].y + 3, White, Button[butnum].caption);

		  //if mouse button is clicked
		   if ( KEY_DOWN( VK_LBUTTON )) 
		   {
				Button[butnum].clicked = !Button[butnum].clicked;
			}
	  }

	  if ( Button[butnum].clicked )
	  {
		  DrawBox(Button[butnum].x, Button[butnum].y,  Button[butnum].w,  Button[butnum].h, Black, Green, g_pDevice);
		  PrintText(pFont, Button[butnum].x + 15, Button[butnum].y + 3, White, Button[butnum].caption);
	  }
}

-Freeheadshot
Freeheadshot is online now

Reply With Quote

Old 08-19-2010, 11:28 AM   #3
Member

acid_buRn's Avatar

Threadstarter
Join Date: Dec 2009
Posts: 68
Reputation: 384
Rep Power: 31
acid_buRn has learned Kazaa is not a third world countryacid_buRn has learned Kazaa is not a third world countryacid_buRn has learned Kazaa is not a third world countryacid_buRn has learned Kazaa is not a third world country
Points: 1,965, Level: 3
Points: 1,965, Level: 3 Points: 1,965, Level: 3 Points: 1,965, Level: 3
Activity: 2.3%
Activity: 2.3% Activity: 2.3% Activity: 2.3%
Last Achievements
Quote:
Originally Posted by Freeheadshot View Post
Try this:
Code:
void AddButton(int bnum, char *bcaption, int bx, int by, int bw, int bh )
{
     Button[bnum].num       = bnum;
     Button[bnum].caption   = bcaption;
     Button[bnum].x         = bx;
     Button[bnum].y         = by;
     Button[bnum].w         = bw;
     Button[bnum].h         = bh;
     Button[bnum].clicked   = false;
}
#define KEY_DOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)
void RenderButton(int butnum)
{
     int mw = Button[butnum].x + Button[butnum].w;
     int mh = Button[butnum].y + Button[butnum].h;

	 //Defualt apperance
	 DrawBox(Button[butnum].x, Button[butnum].y,  Button[butnum].w,  Button[butnum].h, Black, Red,g_pDevice);
	 PrintText(pFont, Button[butnum].x + 15, Button[butnum].y + 3, White, Button[butnum].caption);

	 POINT cur;
     GetCursorPos( &cur );

	 //if the mouse coords are the same as the buttons coords
      if ( cur.x > Button[butnum].x &&  cur.x < mw && cur.y > Button[butnum].y && cur.y < mh )
	  {
		   DrawBox(Button[butnum].x, Button[butnum].y,  Button[butnum].w,  Button[butnum].h, Black, Blue, g_pDevice);
		   PrintText(pFont, Button[butnum].x + 15, Button[butnum].y + 3, White, Button[butnum].caption);

		  //if mouse button is clicked
		   if ( KEY_DOWN( VK_LBUTTON )) 
		   {
				Button[butnum].clicked = !Button[butnum].clicked;
			}
	  }

	  if ( Button[butnum].clicked )
	  {
		  DrawBox(Button[butnum].x, Button[butnum].y,  Button[butnum].w,  Button[butnum].h, Black, Green, g_pDevice);
		  PrintText(pFont, Button[butnum].x + 15, Button[butnum].y + 3, White, Button[butnum].caption);
	  }
}

-Freeheadshot
Thanks for the help, But it didnt work.
I can now hold the button for the hack to work, But once i let go, The hack turns off D:

Any other ideas..?
acid_buRn is offline

Reply With Quote

Old 08-19-2010, 11:42 AM   #4
UnKnoWnCheaTeR

Freeheadshot's Avatar

Join Date: Mar 2010
Location: Germany
Posts: 941
Reputation: 40621
Rep Power: 448
Freeheadshot has a huge epeen!Freeheadshot has a huge epeen!Freeheadshot has a huge epeen!Freeheadshot has a huge epeen!Freeheadshot has a huge epeen!Freeheadshot has a huge epeen!Freeheadshot has a huge epeen!Freeheadshot has a huge epeen!Freeheadshot has a huge epeen!Freeheadshot has a huge epeen!Freeheadshot has a huge epeen!
Recognitions:
The UC Member of the Month award is a prestigious award given to a single community member on a monthly basis. Based on a vote by UnKnoWnCheaTs staff, the award is given to the forum member that has shown exemplary achievement and potential in the UnKnoWnCheaTs community, and has shown great commitment to upholding the principles upon which UnKnoWnCheaTs stands for. A member who has been awarded the Member of the Month award has been distinguished as an asset to the UnKnoWnCheaTs community. Member of the Month
Points: 25,225, Level: 22
Points: 25,225, Level: 22 Points: 25,225, Level: 22 Points: 25,225, Level: 22
Activity: 14.1%
Activity: 14.1% Activity: 14.1% Activity: 14.1%
Last Achievements
Justf think about it by yourslef it have to do with the buttons .... now try abit around
Freeheadshot is online now

Reply With Quote

Old 08-21-2010, 02:01 AM   #5
Level 3

Stevepwns's Avatar

Join Date: Feb 2007
Posts: 253
Reputation: 1368
Rep Power: 79
Stevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slaves
Points: 5,268, Level: 7
Points: 5,268, Level: 7 Points: 5,268, Level: 7 Points: 5,268, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Last Achievements
well, that code looks strangly like the source i released, heres the rest of it from the original post.

Button Menu D3D9

what i did to select the action once its is

void ClickButton(int btn)
{
if (Button[btn].clicked)
}
switch (btn)
{
case 1:
//do something
Breake;
}
}
else
{
//do something else
}
}


this proxy coode you can figure it out
__________________
(\_/)
(O.o)
(> <)
This is [UC Bunny]. Copy [UC Bunny] into your signature to help him on his way to world domination :]

Last edited by Stevepwns; 08-21-2010 at 02:05 AM.
Stevepwns is offline

Reply With Quote

Old 08-21-2010, 02:18 AM   #6
UnKnoWnCheaTeR

disavow's Avatar

Join Date: Jul 2009
Posts: 1,068
Reputation: 49844
Rep Power: 551
disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (2)
Points: 31,279, Level: 26
Points: 31,279, Level: 26 Points: 31,279, Level: 26 Points: 31,279, Level: 26
Activity: 13.8%
Activity: 13.8% Activity: 13.8% Activity: 13.8%
Last Achievements
Happens often when you nest a GetAsyncKeyState within a lot of jmp's such as this.
I'm guessing your iterating through this check several times.
Free up the hotkey check.
__________________

Shad0w_'s Alter Ego
disavow is online now

Reply With Quote

Old 08-21-2010, 02:59 AM   #7
A God

Tatez's Avatar

Join Date: Nov 2009
Location: NC
Posts: 195
Reputation: 3189
Rep Power: 62
Tatez is a legend in the cheating communityTatez is a legend in the cheating communityTatez is a legend in the cheating communityTatez is a legend in the cheating communityTatez is a legend in the cheating communityTatez is a legend in the cheating communityTatez is a legend in the cheating communityTatez is a legend in the cheating communityTatez is a legend in the cheating communityTatez is a legend in the cheating communityTatez is a legend in the cheating community
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (1)
Add a '& 1' or something. If all else fails, you may have to resort to a very short Sleep(), maybe about 200 milliseconds long.
Tatez is offline

Reply With Quote

Old 08-21-2010, 04:14 AM   #8
SEGnosis
Guest

Posts: n/a
Oh yea, sleeping in rendering.
Wisdom from the best >_>;

Reply With Quote

Old 08-21-2010, 04:32 AM   #9
UnKnoWnCheaTeR

disavow's Avatar

Join Date: Jul 2009
Posts: 1,068
Reputation: 49844
Rep Power: 551
disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!disavow has a huge epeen!
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (2)
Points: 31,279, Level: 26
Points: 31,279, Level: 26 Points: 31,279, Level: 26 Points: 31,279, Level: 26
Activity: 13.8%
Activity: 13.8% Activity: 13.8% Activity: 13.8%
Last Achievements
Quote:
Originally Posted by SEGnosis View Post
Oh yea, sleeping in rendering.
Wisdom from the best >_>;
Sleep(200) for 5fps
Gotta love these cats.
__________________

Shad0w_'s Alter Ego
disavow is online now

Reply With Quote

Old 08-22-2010, 03:21 AM   #10
A God

Tatez's Avatar

Join Date: Nov 2009
Location: NC
Posts: 195
Reputation: 3189
Rep Power: 62
Tatez is a legend in the cheating communityTatez is a legend in the cheating communityTatez is a legend in the cheating communityTatez is a legend in the cheating communityTatez is a legend in the cheating communityTatez is a legend in the cheating communityTatez is a legend in the cheating communityTatez is a legend in the cheating communityTatez is a legend in the cheating communityTatez is a legend in the cheating communityTatez is a legend in the cheating community
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (1)
Quote:
Originally Posted by SEGnosis View Post
Oh yea, sleeping in rendering.
Wisdom from the best >_>;
I've done that in a menu before and it was barely noticeable. Give it a try. I said, "If all else fails". That's definitely not a plan A. I'm 100% aware that sleeping in a DirectX hook pauses the game.
Tatez is offline

Reply With Quote

Old 08-22-2010, 03:46 PM   #11
Level 3

Stevepwns's Avatar

Join Date: Feb 2007
Posts: 253
Reputation: 1368
Rep Power: 79
Stevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slaves
Points: 5,268, Level: 7
Points: 5,268, Level: 7 Points: 5,268, Level: 7 Points: 5,268, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Last Achievements
define KEY_DOWN.......was your problem, Leave the menu how i coded it originally, it works fine how it is.
__________________
(\_/)
(O.o)
(> <)
This is [UC Bunny]. Copy [UC Bunny] into your signature to help him on his way to world domination :]
Stevepwns is offline

Reply With Quote

Old 08-24-2010, 07:57 AM   #12
Member

acid_buRn's Avatar

Threadstarter
Join Date: Dec 2009
Posts: 68
Reputation: 384
Rep Power: 31
acid_buRn has learned Kazaa is not a third world countryacid_buRn has learned Kazaa is not a third world countryacid_buRn has learned Kazaa is not a third world countryacid_buRn has learned Kazaa is not a third world country
Points: 1,965, Level: 3
Points: 1,965, Level: 3 Points: 1,965, Level: 3 Points: 1,965, Level: 3
Activity: 2.3%
Activity: 2.3% Activity: 2.3% Activity: 2.3%
Last Achievements
Quote:
Originally Posted by Stevepwns View Post
define KEY_DOWN.......was your problem, Leave the menu how i coded it originally, it works fine how it is.
I am using it the way it was released.
If it was working fine, I wouldnt have had to post this thread :P
acid_buRn is offline

Reply With Quote

Old 08-24-2010, 09:40 PM   #13
Junior Member

topblast's Avatar

Join Date: Apr 2010
Posts: 38
Reputation: 24
Rep Power: 23
topblast has made posts that are generally average in quality
Points: 1,699, Level: 3
Points: 1,699, Level: 3 Points: 1,699, Level: 3 Points: 1,699, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Last Achievements
Quote:
Originally Posted by acid_buRn View Post
I am using it the way it was released.
If it was working fine, I wouldnt have had to post this thread :P
Maybe i can help u. It the same problem with my tab menu but i found how to fix it.
topblast is offline

Reply With Quote

Old 08-24-2010, 11:24 PM   #14
Level 3

Stevepwns's Avatar

Join Date: Feb 2007
Posts: 253
Reputation: 1368
Rep Power: 79
Stevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slavesStevepwns has made all of you their subservient e-slaves
Points: 5,268, Level: 7
Points: 5,268, Level: 7 Points: 5,268, Level: 7 Points: 5,268, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Last Achievements
since i wrote it and still use it( slightly altered) i need to see how your using it in order to see whats being done wrong, send me a pm with your source and ill go over it for you, Im ssure it can be fixed easily. Ill get you squared away or Ill just show you how i do mine so you can have a working menu you can use with out any problems
__________________
(\_/)
(O.o)
(> <)
This is [UC Bunny]. Copy [UC Bunny] into your signature to help him on his way to world domination :]
Stevepwns is offline

Reply With Quote

Old 08-25-2010, 02:23 AM   #15
Junior Member

topblast's Avatar

Join Date: Apr 2010
Posts: 38
Reputation: 24
Rep Power: 23
topblast has made posts that are generally average in quality
Points: 1,699, Level: 3
Points: 1,699, Level: 3 Points: 1,699, Level: 3 Points: 1,699, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Last Achievements
Code:
if(keydown(bla bla){
       if(keyup)
                Button.value=!button.value;
       keyup=false;
}else
       keyup=true;
THAT HOW U DO THINGSSSSSSSSSSS
topblast is offline

Reply With Quote

Old 08-25-2010, 03:13 AM   #16
Retired Admin

learn_more's Avatar

Join Date: Sep 2006
Posts: 5,249
Reputation: 93628
Rep Power: 1106
learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (2)
sieg heil Nazi
Points: 70,490, Level: 39
Points: 70,490, Level: 39 Points: 70,490, Level: 39 Points: 70,490, Level: 39
Activity: 24.7%
Activity: 24.7% Activity: 24.7% Activity: 24.7%
Last Achievements
Award-Showcase
no, the if(keyup) will never fire, since the key isnt down anymore when it's up.
__________________
learn_more is offline

Reply With Quote
Reply  

  • Submit Thread to Digg
  • Submit Thread to del.icio.us
  • Submit Thread to StumbleUpon
  • Submit Thread to Google
  • Submit Thread to Facebook
  • Submit Thread to My Yahoo!
  • Submit Thread to MySpace
  • Submit Thread to Twitter
  • Submit Thread to Reddit



Tags
bug, button, menu
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT +1. The time now is 06:08 AM.