Results 1 to 11 of 11
  1. #1
    pr0h4x0r's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    BoobieLand
    Posts
    134
    Reputation
    10
    Thanks
    20
    My Mood
    Relaxed

    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");

  2. #2
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,881
    Reputation
    163
    Thanks
    3,291
    My Mood
    Sleepy
    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));

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

    pr0h4x0r (06-17-2010)

  4. #3
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool
    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 Sealionone 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
    Last edited by topblast; 06-17-2010 at 09:28 AM.
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  5. The Following 3 Users Say Thank You to topblast For This Useful Post:

    mwb1234 (06-17-2010),pr0h4x0r (06-17-2010),whit (06-17-2010)

  6. #4
    pr0h4x0r's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    BoobieLand
    Posts
    134
    Reputation
    10
    Thanks
    20
    My Mood
    Relaxed
    I m noob so here is my nooby question
    Where does that code go top
    directx.h
    Menu.h
    ?

  7. #5
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,881
    Reputation
    163
    Thanks
    3,291
    My Mood
    Sleepy
    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 ?

  8. #6
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool
    Quote Originally Posted by Sealionone View Post
    What if it's windowed mode ?
    LOL that wont be my problem.. I never said it was Perfect
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  9. #7
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,881
    Reputation
    163
    Thanks
    3,291
    My Mood
    Sleepy
    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

  10. #8
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    thanks topblast
    your works ands it simply
    minds to long.....

  11. #9
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool
    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
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  12. #10
    supascimmy's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    asdf
    Posts
    102
    Reputation
    10
    Thanks
    15
    its not even a real crosshair. all your doing is extending it

  13. #11
    ac1d_buRn's Avatar
    Join Date
    Aug 2009
    Gender
    female
    Location
    CA Source Section
    Posts
    3,404
    Reputation
    157
    Thanks
    4,003
    My Mood
    Flirty
    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)

  14. The Following User Says Thank You to ac1d_buRn For This Useful Post:

    whit (06-17-2010)

Similar Threads

  1. [Request] crosshair source code for dedicated server?
    By hamed2011 in forum Call of Duty Modern Warfare 2 Coding / Programming / Source Code
    Replies: 0
    Last Post: 10-13-2011, 05:53 PM
  2. [Detected] CrossHair (&source code)
    By /b/oss in forum Alliance of Valiant Arms (AVA) Hacks & Cheats
    Replies: 64
    Last Post: 07-17-2011, 02:45 PM
  3. [Help] Req source code crosshaire Project Blackout
    By trebell in forum DirectX/D3D Development
    Replies: 2
    Last Post: 03-04-2011, 12:05 PM
  4. [new source] drawing crosshair
    By undergroundhack in forum Programming Tutorials
    Replies: 2
    Last Post: 04-02-2010, 02:34 PM
  5. CF:CH - Crossfire Crosshair - Includes Full Source
    By ferretfate in forum CrossFire Hacks & Cheats
    Replies: 66
    Last Post: 10-13-2009, 01:21 PM