Originally Posted by
msflames3
Hey this is great but there are 2 things.
1) When i make crosshair i get this error:
and i dont no what to define it..
2) I made the box thing for around my menu but it just makes CA d/c when it loads it... what should i do?
Thank you.
I thought you were good at coding.
Acid didn't check this at all because there are a ton of errors if you copy+paste this.
No need for the
Code:
ScreenCenterX = ( float )pViewport->Width / 2;
ScreenCenterY = ( float )pViewport->Height / 2;
I don't even think he looked at this.
Here is how to draw a crosshair :
Code:
//Global declarations
ID3DXLine *p_line = NULL;
D3DVIEWPORT9 oViewport;
//In your hooked function
pDevice->GetViewport(&oViewport);
//Then define these
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( );
}
void drawXHair(D3DCOLOR xhaircolor, int width)
{
DrawLine(( float )(oViewport.Width / 2) - 10, ( float )(oViewport.Height / 2), ( float )(oViewport.Width / 2) + 10, ( float )(oViewport.Height / 2), width, xhaircolor);
DrawLine(( float )(oViewport.Width / 2), ( float )(oViewport.Height / 2) - 10, ( float )(oViewport.Width / 2), ( float )(oViewport.Height / 2) + 10, width, xhaircolor);
}
Then all you need to do is put this where you want to draw it :
Code:
drawXHair(D3DCOLOR_XRGB(255, 0, 0), 2);