Crossfire 3D Boxes
i using the 3D Boxes of s0beit but crash in game, i allready reversed a new class of GetObjectBoxMin and GetObjectBoxMax and still crashing ...
anyone can help - me ?
anyone can help - me ?
Code:
class CLTClient
{
public:
char _0x0000[156];
unsigned int(WINAPI *GetObjectPos)(CObject *Object, D3DXVECTOR3 *Position); //0x009C
char _0x00A0[324];
unsigned int(WINAPI *GetObjectBoxMin)(CObject *Object, D3DXVECTOR3 Min); //0x01E4
unsigned int(WINAPI *GetObjectBoxMax)(CObject *Object, D3DXVECTOR3 Max); //0x01E8
};//Size=0x01EC
void Draw3DPlayerBox( CPlayer *pPlayer, D3DCOLOR drawColor, LPDIRECT3DDEVICE9 pDevice )
{
CLTClient *Client = (CLTClient *)*(DWORD *)LTClient;
if( !pPlayer )
return;
if( !pPlayer->Object )
return;
if( !Client )
return;
D3DXVECTOR3 mins, maxs;
if( Client->GetObjectBoxMin(pPlayer->Object, mins) != 0 )
return;
if( Client->GetObjectBoxMax(pPlayer->Object, maxs) != 0 )
return;
D3DXVECTOR3 pArray[8];
if( WorldToScreen( pDevice, mins, &pArray[0] ) &&
WorldToScreen( pDevice, maxs, &pArray[1] ) &&
WorldToScreen( pDevice, D3DXVECTOR3( mins.x, mins.y, maxs.z ), &pArray[2] ) &&
WorldToScreen( pDevice, D3DXVECTOR3( mins.x, maxs.y, mins.z ), &pArray[3] ) &&
WorldToScreen( pDevice, D3DXVECTOR3( maxs.x, mins.y, mins.z ), &pArray[4] ) &&
WorldToScreen( pDevice, D3DXVECTOR3( maxs.x, maxs.y, mins.z ), &pArray[5] ) &&
WorldToScreen( pDevice, D3DXVECTOR3( maxs.x, mins.y, maxs.z ), &pArray[6] ) &&
WorldToScreen( pDevice, D3DXVECTOR3( mins.x, maxs.y, maxs.z ), &pArray[7] ) )
{
menu->DrawLine( pArray[ 0 ].x, pArray[ 0 ].y, pArray[ 2 ].x, pArray[ 2 ].y, 1, drawColor, pDevice );
menu->DrawLine( pArray[ 0 ].x, pArray[ 0 ].y, pArray[ 3 ].x, pArray[ 3 ].y, 1, drawColor, pDevice );
menu->DrawLine( pArray[ 0 ].x, pArray[ 0 ].y, pArray[ 4 ].x, pArray[ 4 ].y, 1, drawColor, pDevice );
menu->DrawLine( pArray[ 1 ].x, pArray[ 1 ].y, pArray[ 5 ].x, pArray[ 5 ].y, 1, drawColor, pDevice );
menu->DrawLine( pArray[ 1 ].x, pArray[ 1 ].y, pArray[ 6 ].x, pArray[ 6 ].y, 1, drawColor, pDevice );
menu->DrawLine( pArray[ 1 ].x, pArray[ 1 ].y, pArray[ 7 ].x, pArray[ 7 ].y, 1, drawColor, pDevice );
menu->DrawLine( pArray[ 2 ].x, pArray[ 2 ].y, pArray[ 7 ].x, pArray[ 7 ].y, 1, drawColor, pDevice );
menu->DrawLine( pArray[ 2 ].x, pArray[ 2 ].y, pArray[ 6 ].x, pArray[ 6 ].y, 1, drawColor, pDevice );
menu->DrawLine( pArray[ 3 ].x, pArray[ 3 ].y, pArray[ 7 ].x, pArray[ 7 ].y, 1, drawColor, pDevice );
menu->DrawLine( pArray[ 4 ].x, pArray[ 4 ].y, pArray[ 6 ].x, pArray[ 6 ].y, 1, drawColor, pDevice );
menu->DrawLine( pArray[ 5 ].x, pArray[ 5 ].y, pArray[ 3 ].x, pArray[ 3 ].y, 1, drawColor, pDevice );
menu->DrawLine( pArray[ 5 ].x, pArray[ 5 ].y, pArray[ 4 ].x, pArray[ 4 ].y, 1, drawColor, pDevice );
}
}
Code:
if(engine->Players[i].pPlayer->Team != engine->pLocal->Team)
{
if(boxes)
Draw3DPlayerBox(engine->Players[i].pPlayer, ESPColor, pDevice);
}



