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.
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!!
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.
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.
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 :]