Crossfire perfect 2d box esp

Posts 1–9 of 9 · Page 1 of 1
Crossfire perfect 2d box esp
Believe it or not, it took longer to figure out than i thought (at the time)
Code:
void CESP::Draw2DPlayerBox( CF_Player *pPlayer, DWORD drawColor ) 
{ 
    if( !pPlayer ) 
        return; 

    if( !pPlayer->Object ) 
        return; 

    if( !g_Engine.GetClient() ) 
        return; 

    LTVector vCenter, vFoot, vHead; 

    //this is the centered position 
    if( g_Engine.GetClient()->GetObjectPos( pPlayer->Object, &vCenter ) != LT_OK ) 
        return; 

    //foot (bottom) 
    if( g_Engine.GetClient()->GetObjectBoxMin( pPlayer->Object, vFoot ) != LT_OK ) 
        return; 

    //head (top) 
    if( g_Engine.GetClient()->GetObjectBoxMax( pPlayer->Object, vHead ) != LT_OK ) 
        return; 

    //center the positions for 2d boxes 
    vFoot.x = vCenter.x; 
    vFoot.z = vCenter.z; 
    vHead.x = vCenter.x; 
    vHead.z = vCenter.z; 

    LTVector vPlayerFootScreen, vPlayerHeadScreen; 

    if( g_Engine.LTWorldToScreen( vFoot, vPlayerFootScreen ) && g_Engine.LTWorldToScreen( vHead, vPlayerHeadScreen ) ) 
    { 
        float w = ( vPlayerFootScreen.y - vPlayerHeadScreen.y ) / 4; 

        g_Engine.OutlineRGBA( vPlayerHeadScreen.x - w, vPlayerHeadScreen.y, w * 2, ( vPlayerFootScreen.y - vPlayerHeadScreen.y ), 1.0f, 
            RED( drawColor ), GREEN( drawColor ), BLUE( drawColor ), ALPHA( drawColor ) ); 
    } 
}
Credits : s0beit
Very Old !
and it's not yours !
Proof !
Credits : s0beit
Another 2D Boxes Code

Code:
D3DXVECTOR3 GetMidPoint (D3DXVECTOR3 V1, D3DXVECTOR3 V2)
{
	D3DXVECTOR3 Mid;
	Mid.x = (V1.x+V2.x) / 2;
	Mid.y = (V1.y+V2.y) / 2;
	Mid.z = (V1.z+V2.z) / 2;
	return Mid;
}

if(Boxes2D)
{
	D3DXVECTOR3 Pos0, Pos1, Pos2, Pos3, Pos4;
	Pos0 = GetMidPoint(GetBonePosition(pPlayer->Object, 6), GetBonePosition(pPlayer->Object, 3));
	Pos1 = Pos0 + D3DXVECTOR3(-50, 160, 0);
	Pos2 = Pos0 + D3DXVECTOR3(-50, -160, 0);
	Pos3 = Pos0 + D3DXVECTOR3(50, -160, 0);
	Pos4 = Pos0 + D3DXVECTOR3(50, 160, 0);
	if (Trans3DTo2D(pDevice, &Pos1) && Trans3DTo2D(pDevice, &Pos2) && Trans3DTo2D(pDevice, &Pos3) && Trans3DTo2D(pDevice, &Pos4))
	{
		DrawLine(pDevice, Pos1.x, Pos1.y, Pos2.x, Pos2.y, ESP_Color);
		DrawLine(pDevice, Pos2.x, Pos2.y, Pos3.x, Pos3.y, ESP_Color);
		DrawLine(pDevice, Pos3.x, Pos3.y, Pos4.x, Pos4.y, ESP_Color);
		DrawLine(pDevice, Pos4.x, Pos4.y, Pos1.x, Pos1.y, ESP_Color);
	}
}
Another Code :
Code:
// Fill RGB
void FillRGB( int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* pDevice )
{
	D3DRECT rec = { x, y, x + w, y + h };
	pDevice->Clear( 1, &rec, D3DCLEAR_TARGET, color, 0, 0 );
}
// DrawBordere
void DrawBordere( int x, int y, int w, int h, int px, D3DCOLOR BorderColor, IDirect3DDevice9* pDevice )
{
	FillRGB( x, (y + h - px), w, px,	BorderColor, pDevice );
	FillRGB( x, y, px, h,				BorderColor, pDevice );
	FillRGB( x, y, w, px,				BorderColor, pDevice );
	FillRGB( (x + w - px), y, px, h,	BorderColor, pDevice );
}
Code:
//DRAW ESP BOX
void DrawEspBox( D3DXVECTOR3 Head, D3DXVECTOR3 Foot, DWORD dwColor, LPDIRECT3DDEVICE9 pDevice )
{
	D3DXVECTOR3 Box =  Head - Foot;

 	if( Box.y  < 0 )
 		Box.y *= -1;

	int BoxWidth    = (int)Box.y / 2;
	int DrawX		= (int)Head.x - ( BoxWidth / 2 );
	int DrawY		= (int)Head.y;

	DrawBordere( DrawX, DrawY, BoxWidth, Box.y, 1, dwColor, pDevice );
}
Code:
WorldToScreen ( pDevice, pPlayerInfo->Object->Head,   &pos  );
							WorldToScreen ( pDevice, pPlayerInfo->Object->Origin, &pos2 ); 
                                                        DrawEspBox( pos, pos2, color, pDevice );
Quote Originally Posted by I2espect View Post
Another Code :
Code:
// Fill RGB
void FillRGB( int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* pDevice )
{
	D3DRECT rec = { x, y, x + w, y + h };
	pDevice->Clear( 1, &rec, D3DCLEAR_TARGET, color, 0, 0 );
}
// DrawBordere
void DrawBordere( int x, int y, int w, int h, int px, D3DCOLOR BorderColor, IDirect3DDevice9* pDevice )
{
	FillRGB( x, (y + h - px), w, px,	BorderColor, pDevice );
	FillRGB( x, y, px, h,				BorderColor, pDevice );
	FillRGB( x, y, w, px,				BorderColor, pDevice );
	FillRGB( (x + w - px), y, px, h,	BorderColor, pDevice );
}
Code:
//DRAW ESP BOX
void DrawEspBox( D3DXVECTOR3 Head, D3DXVECTOR3 Foot, DWORD dwColor, LPDIRECT3DDEVICE9 pDevice )
{
	D3DXVECTOR3 Box =  Head - Foot;

 	if( Box.y  < 0 )
 		Box.y *= -1;

	int BoxWidth    = (int)Box.y / 2;
	int DrawX		= (int)Head.x - ( BoxWidth / 2 );
	int DrawY		= (int)Head.y;

	DrawBordere( DrawX, DrawY, BoxWidth, Box.y, 1, dwColor, pDevice );
}
Code:
WorldToScreen ( pDevice, pPlayerInfo->Object->Head,   &pos  );
							WorldToScreen ( pDevice, pPlayerInfo->Object->Origin, &pos2 ); 
                                                        DrawEspBox( pos, pos2, color, pDevice );
credits: gellin.

Looking that code, you stole from mah base (CFOwnage).
Quote Originally Posted by XarutoUsoCrack View Post
credits: gellin.

Looking that code, you stole from mah base (CFOwnage).
I didn't say it's my code !!!
and i didn't steel it !!!
i just found it on MPGH !! and idk who is his creator !
Quote Originally Posted by XarutoUsoCrack View Post
credits: gellin.

Looking that code, you stole from mah base (CFOwnage).
Man just Stop Doing That We All Know he didnt make it you must write any thing right lol
Posts 1–9 of 9 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us