Crosshair source?

Posts 1–11 of 11 · Page 1 of 1
Crosshair source?
ok i have this
but if its wrong please correct it for me
Code:
             PushToConsole("CrossHair_DefaultLength 50");
			PushToConsole("CrossHair_DefaultGapLength 1");
			PushToConsole("CrosshairGapMin 0");
			PushToConsole("CrosshairGapMax 2");
			PushToConsole("CrosshairBarMin 100");
			PushToConsole("CrosshairBarMax 100");
			PushToConsole("HitCrossHairMAXPerturb 0");
			PushToConsole("HitCrossHairMINPerturb 0");	
			PushToConsole("HitCrossHairSize 0");
			PushToConsole("CrossHair_FiringDuration 0");
			PushToConsole("ScopeUDRadius 0");
			PushToConsole("ScopeLRRadius 0");
			PushToConsole("ScopeUPGap 0");
			PushToConsole("ScopeLRGap 0");
			PushToConsole("ShowBreath 0");
Most PTC commands don't work. You can use D3D to draw a crosshair though, this is straight from my hack :

Code:
//Allocate memory

ID3DXLine *p_line = NULL;
D3DVIEWPORT9 oViewport;

//Create it (need to hook to do this)

D3DXCreateLine(pDevice, &p_line);
pDevice->GetViewport(&oViewport);

//Draw it using this function (From another source but I forgot who made)

void DrawLine(float x, float y, float x2, float y2, float width, DWORD color)
{
	D3DXVECTOR2 vLine[2];
	p_line->SetWidth( width );
	p_line->SetAntialias( false );
	p_line->SetGLLines( true );
	vLine[0].x = x;
	vLine[0].y = y;
	vLine[1].x = x2;
	vLine[1].y = y2;
	p_line->Begin( );
	p_line->Draw( vLine, 2, color );
	p_line->End( );
}

DrawLine((float)(oViewport.Width / 2) - 10, (float)(oViewport.Height / 2), (float)(oViewport.Width / 2) + 10, (float)(oViewport.Height / 2), 1, D3DCOLOR_XRGB(255, 0, 0));
DrawLine((float)(oViewport.Width / 2), (float)(oViewport.Height / 2) - 10, (float)(oViewport.Width / 2), (float)(oViewport.Height / 2) + 10, 1, D3DCOLOR_XRGB(255, 0, 0));
Quote Originally Posted by pr0h4x0r View Post
ok i have this
but if its wrong please correct it for me
Code:
             PushToConsole("CrossHair_DefaultLength 50");
			PushToConsole("CrossHair_DefaultGapLength 1");
			PushToConsole("CrosshairGapMin 0");
			PushToConsole("CrosshairGapMax 2");
			PushToConsole("CrosshairBarMin 100");
			PushToConsole("CrosshairBarMax 100");
			PushToConsole("HitCrossHairMAXPerturb 0");
			PushToConsole("HitCrossHairMINPerturb 0");	
			PushToConsole("HitCrossHairSize 0");
			PushToConsole("CrossHair_FiringDuration 0");
			PushToConsole("ScopeUDRadius 0");
			PushToConsole("ScopeLRRadius 0");
			PushToConsole("ScopeUPGap 0");
			PushToConsole("ScopeLRGap 0");
			PushToConsole("ShowBreath 0");

Your Right.. Butit look like a Perfect Copy our of Blast Hack.. Just Saying because i remember putting the 1 the 0 and the 2 when i was editing


Quote Originally Posted by Crash View Post
Most PTC commands don't work. You can use D3D to draw a crosshair though, this is straight from my hack :

Code:
//Allocate memory

ID3DXLine *p_line = NULL;
D3DVIEWPORT9 oViewport;

//Create it (need to hook to do this)

D3DXCreateLine(pDevice, &p_line);
pDevice->GetViewport(&oViewport);

//Draw it using this function (From another source but I forgot who made)

void DrawLine(float x, float y, float x2, float y2, float width, DWORD color)
{
	D3DXVECTOR2 vLine[2];
	p_line->SetWidth( width );
	p_line->SetAntialias( false );
	p_line->SetGLLines( true );
	vLine[0].x = x;
	vLine[0].y = y;
	vLine[1].x = x2;
	vLine[1].y = y2;
	p_line->Begin( );
	p_line->Draw( vLine, 2, color );
	p_line->End( );
}

DrawLine((float)(oViewport.Width / 2) - 10, (float)(oViewport.Height / 2), (float)(oViewport.Width / 2) + 10, (float)(oViewport.Height / 2), 1, D3DCOLOR_XRGB(255, 0, 0));
DrawLine((float)(oViewport.Width / 2), (float)(oViewport.Height / 2) - 10, (float)(oViewport.Width / 2), (float)(oViewport.Height / 2) + 10, 1, D3DCOLOR_XRGB(255, 0, 0));

This look Like it will Hurt My Head so let me put what i have for my Crosshair and it is Less Lag


Code:
void CrossHair(LPDIRECT3DDEVICE9 pDevice, Int size, int strong,  D3DCOLOR xcolor)

void CLASS::CrossHair(LPDIRECT3DDEVICE9 pDevice, Int size, int strong,  D3DCOLOR xcolor){
	int iCenterX = GetSystemMetrics( 0 ) / 2;
	int iCenterY = GetSystemMetrics( 1 ) / 2;
	if( iCenterX < 20 && iCenterY < 20 )
	{
		//Just to be sure :P
		iCenterX = ( GetSystemMetrics( 0 ) / 2 );
		iCenterY = ( GetSystemMetrics( 1 ) / 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);
	//TOPBLAST DID THIS ALONE
}

CLASS.CrossHair(pDevice, 20, 2,  D3DCOLOR_ARGB( 255, 255, 0, 0 ));

100% TOPBLAST And I made it 100% Copy and Paste-able
Topblast Was Hay
Quote Originally Posted by topblast View Post



Your Right.. Butit look like a Perfect Copy our of Blast Hack.. Just Saying because i remember putting the 1 the 0 and the 2 when i was editing





This look Like it will Hurt My Head so let me put what i have for my Crosshair and it is Less Lag


Code:
void CrossHair(LPDIRECT3DDEVICE9 pDevice, Int size, int strong,  D3DCOLOR xcolor)

void CLASS::CrossHair(LPDIRECT3DDEVICE9 pDevice, Int size, int strong,  D3DCOLOR xcolor){
	int iCenterX = GetSystemMetrics( 0 ) / 2;
	int iCenterY = GetSystemMetrics( 1 ) / 2;
	if( iCenterX < 20 && iCenterY < 20 )
	{
		//Just to be sure :P
		iCenterX = ( GetSystemMetrics( 0 ) / 2 );
		iCenterY = ( GetSystemMetrics( 1 ) / 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);
	//TOPBLAST DID THIS ALONE
}

CLASS.CrossHair(pDevice, 20, 2,  D3DCOLOR_ARGB( 255, 255, 0, 0 ));

100% TOPBLAST And I made it 100% Copy and Paste-able
Topblast Was Hay
What if it's windowed mode ?
Quote Originally Posted by Crash View Post
What if it's windowed mode ?
LOL that wont be my problem.. I never said it was Perfect
Quote Originally Posted by topblast View Post


LOL that wont be my problem.. I never said it was Perfect
Viewport = always correct X/Y on screen
I m noob so here is my nooby question
Where does that code go top
directx.h
Menu.h
?
thanks topblast
your works ands it simply
minds to long.....
When i get back home in 2 hrs (IF I DO AND EVERYTHING GOES WELL D)

I will Make a GUI Hacking SDK from all my knowledge from what I work on while in Fire God
its not even a real crosshair. all your doing is extending it
Globals:

[php]
float ScreenCenterX = 0.0f;//Horizontal Position
float ScreenCenterY = 0.0f;//Vertical Position
[/php]

SetViewport:

[php]
ScreenCenterX = ( float )pViewport->Width / 2;
ScreenCenterY = ( float )pViewport->Height / 2;
[/php]

Endscene:

[php]
if(xhair)
{
D3DVIEWPORT9 viewP;
pDevice->GetViewport( &viewP );
DWORD ScreenCenterX = viewP.Width / 2;
DWORD ScreenCenterY = viewP.Height / 2;

D3DRECT rec1 = {ScreenCenterX-25, ScreenCenterY, ScreenCenterX+ 25, ScreenCenterY+2};
D3DRECT rec2 = {ScreenCenterX, ScreenCenterY-25, ScreenCenterX+ 2,ScreenCenterY+25};

pDevice->Clear( 1, &rec1, D3DCLEAR_TARGET, D3DXCOLOR(1.0, 0.0, 0.0, 1.0), 0, 0 );
pDevice->Clear( 1, &rec2, D3DCLEAR_TARGET, D3DXCOLOR(1.0, 0.0, 0.0, 1.0), 0, 0 );
}
[/php]

Best crosshair to use becuase it always draws in the middle, no matter the resolution.
Dont think windowed mode affects it either (havent tried in windowed)
Posts 1–11 of 11 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?