you need the player position and have to find out where the models on your screen. now you can draw the informations eg. draw(health, headx, heady) :P
Code:
void Esp::DrawEsp( void )
{
if ( !HalFLife2.m_pMyPlayer->BaseEnt() )
return;
player_info_t pInfo; //Get Shit info About players
Vector vScreen; //see my name
Vector vWorldPosition; //see my name
Vector vPlayerHead; //see my name
for ( int index = 0; index < HalFLife2.m_pEntList->GetHighestEntityIndex(); index++ )
{
if ( index == HalFLife2.m_pEngine->GetLocalPlayer() )
continue;
IClientEntity* ClientEntity = HalFLife2.m_pEntList->GetClientEntity( index );
if ( ClientEntity == NULL
|| ClientEntity->IsDormant() )
continue;
CBaseEntity* pBaseEntity = ClientEntity->GetBaseEntity();
if ( pBaseEntity == NULL
|| pBaseEntity->IsDormant() )
continue;
int *iTeamIndex = (int*) ((DWORD)pBaseEntity +(DWORD)0x90 );
DWORD dwGetTeamColor = CHEAT_WHITE;
if ( HalFLife2.m_pAimbot->GetVisible( HalFLife2.m_pMyPlayer->BaseEnt()->EyePosition(), pBaseEntity->EyePosition(), pBaseEntity ) )//visible
{
if( *iTeamIndex == 2 ) //Terrorist
dwGetTeamColor = CHEAT_RED;
if( *iTeamIndex == 3 )// Counter-Terrorist
dwGetTeamColor = CHEAT_BLUE;
if ( HalFLife2.m_pAimbot->iGetTarget() == index )//Aimed Guy
dwGetTeamColor = CHEAT_PURPLE;
}
else//invisible (hidden guy)
{
if( *iTeamIndex == 2 ) //Terrorist
dwGetTeamColor = CHEAT_ORANGE;
if( *iTeamIndex == 3 )// Counter-Terrorist
dwGetTeamColor = CHEAT_GREEN;
if ( HalFLife2.m_pAimbot->iGetTarget() == index )//Aimed Guy
dwGetTeamColor = CHEAT_BLACK;
}
//get position
HalFLife2.m_pNeeded->GetWorldSpaceCenter( pBaseEntity , vWorldPosition );
//set position of player on screen
if ( HalFLife2.m_pNeeded->WorldToScreen( vWorldPosition, vScreen ) )
{
//get player info
if ( HalFLife2.m_pEngine->GetPlayerInfo( index, &pInfo ) )
{
//Get Life State
int *lifestate = (int*) ( ( DWORD )pBaseEntity + ( DWORD )0x87 );
//Get Health
int *pdwHealth = (int*) ( (DWORD)pBaseEntity + (DWORD)0xDA4 );
//Draw if Alive
if( *lifestate == LIFE_ALIVE )
{
if ( HalFLife2.m_pNeeded->WorldToScreen( pBaseEntity->EyePosition(), vPlayerHead ) )
{
//Set Bounding Box color
HalFLife2.m_pMatSurface->DrawSetColor( RGBA(dwGetTeamColor) );
//Draw Bounding Box
HalFLife2.m_pMatSurface->DrawOutlinedRect( vPlayerHead.x - 20, vPlayerHead.y - 20, vPlayerHead.x + 20, vPlayerHead.y + 60 );
}
//Draw ESP Name
HalFLife2.m_pNeeded->DrawString( vScreen.x, vScreen.y, dwGetTeamColor, "%s", pInfo.name );
//Draw ESP Health
HalFLife2.m_pNeeded->DrawString( vScreen.x, vScreen.y + 16 , dwGetTeamColor, "%i", *pdwHealth );
}
}
}
}
}
gamedeception.net