# Thread: Problem, I need help.

1. ## Problem, I need help.

This is the code I'm using thanks to Rusty.

Code:
```void DrawCircle(int X, int Y, int radius, int numSides, DWORD Color)
{
DrawCircle(CenterX,CenterY,8,8,RED);
D3DXVECTOR2 Line[128];
float Step = PI * 2.0 / numSides;
int Count = 0;
for (float a=0; a < PI*2.0; a += Step)
{
float X1 = radius * cos(a) + X;
float Y1 = radius * sin(a) + Y;
float X2 = radius * cos(a+Step) + X;
float Y2 = radius * sin(a+Step) + Y;
Line[Count].x = X1;
Line[Count].y = Y1;
Line[Count+1].x = X2;
Line[Count+1].y = Y2;
Count += 2;
}
pLine->Begin();
pLine->Draw(Line,Count,Color);
pLine->End();
}```
I'm using Visual Studio 2010, and it says that pLine is not defined.

How could I fix that, might be an easy fix but I'm not ashamed to ask because I'm a starter and hope to learn from my mistakes.

2. declare this; ID3DXLine *pLine;

3. ## The Following User Says Thank You to anaestheist For This Useful Post:

-xGhost- (11-01-2010)

4. Originally Posted by anaestheist
declare this; ID3DXLine *pLine;

Thank you so much, Rep++

5. Post in source code help disscussion section next time

6. I luv whit /

7. Originally Posted by anaestheist
I luv whit /
I saw him first! Jking

8. well props to anaethiest for helping

but Ghost dude in C++ u have to define things.. u should really start out with the basic syntax

9. Im happy to help when i can :P i am also beginning in C++.

10. Originally Posted by anaestheist
Im happy to help when i can :P i am also beginning in C++.
same here. I started with hotkey hack and then went onto menu.
then I thought it was stupid and actually started to learn to program.
the only difference is that I googled my errors and learned off of the bases and I didn't come here with all of my questions i just took the time to figure it out.

mind you back then it was a lot easier

11. I have another question which I think I can answer but for some apparent reason the method I'm using does not work, here is my code,

Code:
```void DrawCircle(int X, int Y, int radius, int numSides, DWORD Color)
{
DrawCircle(CenterX,CenterY,8,8,RED);
D3DXVECTOR2 Line[128];
float Step = PI * 2.0 / numSides;
int Count = 0;
for (float a=0; a < PI*2.0; a += Step)
{
float X1 = radius * cos(a) + X;
float Y1 = radius * sin(a) + Y;
float X2 = radius * cos(a+Step) + X;
float Y2 = radius * sin(a+Step) + Y;
Line[Count].x = X1;
Line[Count].y = Y1;
Line[Count+1].x = X2;
Line[Count+1].y = Y2;
Count += 2;
}
pLine->Begin();
pLine->Draw(Line,Count,Color);
pLine->End();
}```
and here is my method,

Code:
```void DrawCircle(int X, int Y, int radius, int numSides, DWORD Color)
{
if (hack7 == 1)show=(show);
DrawCircle(CenterX,CenterY,8,8,RED);
D3DXVECTOR2 Line[128];
float Step = PI * 2.0 / numSides;
int Count = 0;
for (float a=0; a < PI*2.0; a += Step)
{
float X1 = radius * cos(a) + X;
float Y1 = radius * sin(a) + Y;
float X2 = radius * cos(a+Step) + X;
float Y2 = radius * sin(a+Step) + Y;
Line[Count].x = X1;
Line[Count].y = Y1;
Line[Count+1].x = X2;
Line[Count+1].y = Y2;
Count += 2;
}
pLine->Begin();
pLine->Draw(Line,Count,Color);
pLine->End();
}```
Can anyone care to explain to me why the crosshair's do not show up in-game when I put "Hack7" On?

12. Originally Posted by anaestheist
declare this; ID3DXLine *pLine;

[php]ID3DXLine *pLine;
D3DXCreateLine(pDevice,&D3D.pLine);[/php]

when u not use this the game crash

13. Originally Posted by -xGhost-
I have another question which I think I can answer but for some apparent reason the method I'm using does not work, here is my code,

Code:
```void DrawCircle(int X, int Y, int radius, int numSides, DWORD Color)
{
DrawCircle(CenterX,CenterY,8,8,RED);
D3DXVECTOR2 Line[128];
float Step = PI * 2.0 / numSides;
int Count = 0;
for (float a=0; a < PI*2.0; a += Step)
{
float X1 = radius * cos(a) + X;
float Y1 = radius * sin(a) + Y;
float X2 = radius * cos(a+Step) + X;
float Y2 = radius * sin(a+Step) + Y;
Line[Count].x = X1;
Line[Count].y = Y1;
Line[Count+1].x = X2;
Line[Count+1].y = Y2;
Count += 2;
}
pLine->Begin();
pLine->Draw(Line,Count,Color);
pLine->End();
}```
and here is my method,

Code:
```void DrawCircle(int X, int Y, int radius, int numSides, DWORD Color)
{
if (hack7 == 1)show=(show);
DrawCircle(CenterX,CenterY,8,8,RED);
D3DXVECTOR2 Line[128];
float Step = PI * 2.0 / numSides;
int Count = 0;
for (float a=0; a < PI*2.0; a += Step)
{
float X1 = radius * cos(a) + X;
float Y1 = radius * sin(a) + Y;
float X2 = radius * cos(a+Step) + X;
float Y2 = radius * sin(a+Step) + Y;
Line[Count].x = X1;
Line[Count].y = Y1;
Line[Count+1].x = X2;
Line[Count+1].y = Y2;
Count += 2;
}
pLine->Begin();
pLine->Draw(Line,Count,Color);
pLine->End();
}```
Can anyone care to explain to me why the crosshair's do not show up in-game when I put "Hack7" On?
Try this;

if (hack7 == 1) show = !show;

Doubt it work anyway, i don't see anywhere in your code where it would hide/show the crosshair? correct me if im wrong..

14. Originally Posted by kotentopf
[php]ID3DXLine *pLine;
D3DXCreateLine(pDevice,&D3D.pLine);[/php]

when u not use this the game crash
you beat me to it
Was about to say, You still need to create your line

&& to use it, Just do

if(hack == 1) {
DrawCircle(...);
}

15. why do you even have the if(hack7 == 1) in your draw circle?

You also can not call drawCircle inside of the code where you define it, take the two lines:
Code:
```if(hack7==1){
CrawCircle()```
and move it out of the void.

Also the hack7=(!hack7) will just instantly turn it back off.

16. [php] if (needstolearncplusplus7 == 1) {
learn c++ () [/php]

try that, it works!

Page 1 of 2 12 Last