[Help] Menu

Posts 16–22 of 22 · Page 2 of 2
made dis the other day. in b4 leachers . ez add items just by adding strings to array. grr dumb highlight messes it up.

Code:
struct Items 
{
	char *Name;
	int Val;
}Hack[100];

struct MenuSettings
{
	int CurrentIndex;
	bool show;
}nMenu;

RECT Text;

cMenu Menu;

char *OnOff[] = { "0", "1" };

char *MenuItems[] = { 
					"Aimbot" ,
					"Telekill",
					"Name ESP" ,
					"Box ESP" ,
					"Weapon ESP"
					};

void cMenu::DrawMenu( int x, int y, LPD3DXFONT g_pFont, LPDIRECT3DDEVICE9 pDevice )
{
	if(GetAsyncKeyState(VK_INSERT)&1) nMenu.show =! nMenu.show;
	
	if(nMenu.show)
	{
		if(GetAsyncKeyState(VK_UP)&1) if(nMenu.CurrentIndex > 0) nMenu.CurrentIndex--;
		if(GetAsyncKeyState(VK_DOWN)&1) if(nMenu.CurrentIndex < sizeof( MenuItems ) / sizeof( MenuItems[0] ) - 1) nMenu.CurrentIndex++;
		if(GetAsyncKeyState(VK_LEFT)&1) if(Hack[nMenu.CurrentIndex].Val > 0) Hack[nMenu.CurrentIndex].Val--;
		if(GetAsyncKeyState(VK_RIGHT)&1) if(Hack[nMenu.CurrentIndex].Val < 1) Hack[nMenu.CurrentIndex].Val++;
	
		for( int i = 0; i < sizeof( MenuItems ) / sizeof( MenuItems[0] ); i++ )
		{
			Hack[i].Name = MenuItems[i];
			DWORD FontColor;
			SetRect( &Text, x, y + (i * 20), x+150 , y + 20 + (i * 20) );

			if(i != nMenu.CurrentIndex)
				if(Hack[i].Val > 0)
					FontColor = Green;
				else
					FontColor = Red;
			else
				FontColor = White;

			g_pFont->DrawTextA(NULL, Hack[i].Name, -1, &Text, DT_NOCLIP, FontColor);
			g_pFont->DrawTextA(NULL, OnOff[Hack[i].Val], -1, &Text, DT_RIGHT, FontColor);
		}

		SetRect( &Text, x, y - 20, x+150 , y );
		g_pFont->DrawTextA(NULL, ("NOOB MENU"), -1, &Text, DT_CENTER, White);
	}
}
Quote Originally Posted by Nubzgetkillz View Post
if(Hack.Chams == 0){
Hack.Chams ++;
}else{
Hack.Chams --;
}

you can do

if(Hack.Chams) {
Hack.Chams = !Hack.Chams;
}
I'm using
Code:
int Chams;
Quote Originally Posted by flameswor10 View Post
I'm using
Code:
int Chams;
Still would work. True = 1, False = 0. It seems kind of redundant if you are going to do that for every hack in your menu.
Quote Originally Posted by NOOB View Post


Still would work. True = 1, False = 0. It seems kind of redundant if you are going to do that for every hack in your menu.
It doesn't bother me.
Quote Originally Posted by flameswor10 View Post
@NextGen1
C++ help in Programming Section takes too long for answers
That's cause the developers here should be caving over there as well.
Quote Originally Posted by NextGen1 View Post


That's cause the developers here should be caving over there as well.
C/C++ , Reverse Engineering <- best sections yet
Quote Originally Posted by Grim View Post
GetSystemMetrics(SM_CXSCREEN) < width
GetSystemMetrics(SM_CYSCREEN) < height
nothing other than (0) and (1), just defined allready
why not use the Viewport?

Code:
D3DVIEWPORT9 pViewport;
pDevice->GetViewport(&Viewport);

void cDraw::Crosshair(LPDIRECT3DDEVICE9 pDevice, int size, int strong,  D3DCOLOR xcolor)
{
	int iCenterX = (int)D3D.Settings.pViewport.Width/2;
	int iCenterY = (int)D3D.Settings.pViewport.Height/2;

	D3DRECT rec2 = { iCenterX- size, iCenterY, iCenterX+ size, iCenterY+ strong};
	D3DRECT rec3 = { iCenterX, iCenterY- size, iCenterX+ strong,iCenterY+ size};
	pDevice->Clear(1, &rec2, D3DCLEAR_TARGET, xcolor, 1000,  0);
	pDevice->Clear(1, &rec3, D3DCLEAR_TARGET, xcolor, 100,  0);
}
Posts 16–22 of 22 · Page 2 of 2

Post a Reply

Tags for this Thread

None

Talk with us