[RELEASE] Useful Functions

Posts 106–120 of 189 · Page 8 of 13
Quote Originally Posted by CAFlames View Post
ac1d thank you so much it worked! I was able to make xhair! Now onto circle + FPS...



EDIT: Circle,, FPS and drawbox d/c me... i put the
D3DXCreateLine(pDevice,&pLine);
DrawCircle(125,105,15,255,0xffffffff);
together.. we r suppose to do that right?
if not, where do we put D3DXCreateLine(pDevice,&pLine); ?

i put it under the same spot as xhair...

FPS d/cs me to... actually i get an error for it but codernever fixed it... and i d/c.

i also d/c for box.... lol.
What should i do? I mainly want circle. You dont need to hlep me with FPS and box.
You need to create the line firrst (you do that with your font)
Then after the line is created, You can draw the circle
So we put that under pfont? Thats what i dont get.

What font. There r multiple places that mention font
Quote Originally Posted by CAFlames View Post
So we put that under pfont? Thats what i dont get.

What font. There r multiple places that mention font
Its a line, Not text. We dont need fonts LOL
You will see D3DXCreateFont(...)
Put it with that and then draw the circle with the other part of the xhair..
Oooo i gettt ittt

thank yo! Im gonna try that right now. Anf hile im at it. Draw ox i did the same thing. I put lobals and everything under cbase. And i put the last line under menu hotkey and i d/c. I think its my base


EDIT:I still d/c with the circle... let me get this straight.

Globals go at the almost very top. After glboals go right under the globals. D3DCreateline or w/e goes right before d3dcreatefont. Then the endscewne thing goes with my xhair in the render place?

cuz i did that and i d/c..
Quote Originally Posted by CAFlames View Post
Oooo i gettt ittt

thank yo! Im gonna try that right now. Anf hile im at it. Draw ox i did the same thing. I put lobals and everything under cbase. And i put the last line under menu hotkey and i d/c. I think its my base


EDIT:I still d/c with the circle... let me get this straight.

Globals go at the almost very top. After glboals go right under the globals. D3DCreateline or w/e goes right before d3dcreatefont. Then the endscewne thing goes with my xhair in the render place?

cuz i did that and i d/c..
D3DX stuff D/Cs now, as in ID3DXLine/Font.
For the crosshair, instead just do this :
Code:
void DrawLine(int x, int y, int x2, int y2, int width, DWORD color, LPDIRECT3DDEVICE9 pDevice)
{
	
	FillRGB(x, y, x2 - x, y2 - y, color, pDevice);

}
Then all you need to do is get the viewport by doing

DEVICE->GetViewport(...);

and then draw the crosshair :
Code:
//I used oViewport for my viewport
DrawLine((oViewport.Width / 2) - 10, (oViewport.Height / 2), (oViewport.Width / 2) + 10, (oViewport.Height / 2), 1, D3DCOLOR_XRGB(255,0,0), pDevice);
DrawLine((oViewport.Width / 2), (oViewport.Height / 2) - 10, (oViewport.Width / 2), (oViewport.Height / 2) + 10, 1, D3DCOLOR_XRGB(255,0,0), pDevice);
If that doesn't work, you're hooking incorrectly.
Quote Originally Posted by Crash View Post
D3DX stuff D/Cs now, as in ID3DXLine/Font.
For the crosshair, instead just do this :
Code:
void DrawLine(int x, int y, int x2, int y2, int width, DWORD color, LPDIRECT3DDEVICE9 pDevice)
{
	
	FillRGB(x, y, x2 - x, y2 - y, color, pDevice);

}
Then all you need to do is get the viewport by doing

DEVICE->GetViewport(...);

and then draw the crosshair :
Code:
//I used oViewport for my viewport
DrawLine((oViewport.Width / 2) - 10, (oViewport.Height / 2), (oViewport.Width / 2) + 10, (oViewport.Height / 2), 1, D3DCOLOR_XRGB(255,0,0), pDevice);
DrawLine((oViewport.Width / 2), (oViewport.Height / 2) - 10, (oViewport.Width / 2), (oViewport.Height / 2) + 10, 1, D3DCOLOR_XRGB(255,0,0), pDevice);
If that doesn't work, you're hooking incorrectly.
u didnt read above :P

I got crosshair working... it works fine. I just cant get CIRCLE working.... it d/cs.
Well I can't think of anything you're doing wrong..

Code:
//ES or Present :
if(p_line == NULL){
    D3DXCreateLine(...);
}
DrawCircle(...);

//In Reset :
p_line->OnLostDevice();

HRESULT hreturn = oReset(pDevice, pPresentationParameters);

p_line->OnResetDevice();

return hreturn;
Change p_line to the name of your line.
Quote Originally Posted by Crash View Post
Well I can't think of anything you're doing wrong..

Code:
//ES or Present :
if(p_line == NULL){
    D3DXCreateLine(...);
}
DrawCircle(...);

//In Reset :
p_line->OnLostDevice();

HRESULT hreturn = oReset(pDevice, pPresentationParameters);

p_line->OnResetDevice();

return hreturn;
Change p_line to the name of your line.
uhh what?? o.O
Quote Originally Posted by CAFlames View Post


uhh what?? o.O
What's confusing ? It's all there except you need to fill in the ...s with stuff.
where u put DrawCircle(...) Is that the thing thats after global or what?
And ac1d never said anything bout Reset
Quote Originally Posted by CAFlames View Post
where u put DrawCircle(...) Is that the thing thats after global or what?
And ac1d never said anything bout Reset
Well acid is acid.

You reset the line just like your font.
DrawCircle goes wherever the hell you want it to go really.

Put it with the text drawing I guess.
Quote Originally Posted by Crash View Post
Well acid is acid.

You reset the line just like your font.
DrawCircle goes wherever the hell you want it to go really.

Put it with the text drawing I guess.
can u just post the whole code u use? cuz ur basically telling me to use ac1ds and urs.. but im just confused... like i said before... d3d stuff is not my forte
Quote Originally Posted by Crash View Post
Well acid is acid.

You reset the line just like your font.
DrawCircle goes wherever the hell you want it to go really.

Put it with the text drawing I guess.
Shutup kient :P
I dont reset my line and it works fine LOL
When i reset it it used to crash so i took it out
Quote Originally Posted by juggernault5 View Post
This is for C++???????
no its visual basic =.=
Posts 106–120 of 189 · Page 8 of 13
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?