void DrawWorldESP ( int Index )
{
try
{
using boost::lexical_cast;
using std::string;
C_BaseEntity* pBaseEntity = Entity::GetBaseEntity( Index );
Vector worldspacecenter, screencenter;
Color color;
string ccname;
int Team;
//--
if(!pBaseEntity) return;
Team = *Utils::MakePointer<int>( (DWORD) pBaseEntity, _T("DT_BaseEntity->m_iTeamNum") );
//--
if( Team == 2 ) color = Color( 255, 0, 0, 255 );
else color = Color( 0, 0, 255, 255 );
//--
Drawing::GetWorldSpaceCenter( pBaseEntity, worldspacecenter );
if( ! Drawing::WorldToScreen( worldspacecenter, screencenter ) ) return;
ccname = pBaseEntity->GetClientClass()->GetName();
Drawing::BeginESPDraw( screencenter.x, screencenter.y, color );
if ( ccname.find( "CaptureFlag" ) != string::npos )
Drawing::DrawESPText( _T( "--INTELLIGENCE--" ) );
if ( ccname.find( "StunBall" ) != string::npos )
Drawing::DrawESPText( _T( "[B]" ) );
if ( ccname.find( "Projectile_Rocket" ) != string::npos )
Drawing::DrawESPText( _T( "[R]" ) );
if ( ccname.find( "GrenadePipebomb" ) != string::npos )
Drawing::DrawESPText( _T( "[G]" ) );
if ( ccname.find( "Object" ) != string::npos && ccname.find("Objective") == string::npos )
{
int level, health, maxhealth, type;
bool sapper;
C_BaseEntity* pOwner;
level = *Utils::MakePointer< int > ( (DWORD) pBaseEntity, _T( "DT_BaseObjectUpgrade->baseclass->DT_BaseObject->m_iUpgradeLevel" ) );
health = *Utils::MakePointer< int >( (DWORD) pBaseEntity, _T( "DT_BaseObjectUpgrade->baseclass->DT_BaseObject->m_iHealth" ) );
maxhealth = *Utils::MakePointer< int > ( (DWORD) pBaseEntity, _T( "DT_BaseObjectUpgrade->baseclass->DT_BaseObject->m_iMaxHealth" ) );
type = *Utils::MakePointer< int > ( (DWORD) pBaseEntity, _T("DT_BaseObjectUpgrade->baseclass->DT_BaseObject->m_iObjectType") );
sapper = *Utils::MakePointer< bool > ( (DWORD) pBaseEntity, _T("DT_BaseObjectUpgrade->baseclass->DT_BaseObject->m_bHasSapper") );
if ( type == 0 )
{
Drawing::DrawESPText( _T( "Dispenser" ) );
}
else if ( type == 1 )
{
Drawing::DrawESPText( _T( "Teleporter Entrance" ) );
}
else if ( type == 2 )
{
Drawing::DrawESPText( _T( "Teleporter Exit" ) );
}
else if ( type == 3 )
{
Drawing::DrawESPText( _T( "Sentry Gun" ) );
}
if ( sapper )
Drawing::DrawESPText( _T ( "--SAPPER--" ) );
Drawing::DrawESPText( _T( "Level: " ) + lexical_cast< std::tstring, int > ( level ) );
Drawing::DrawESPText( _T( "Health: " ) + lexical_cast< std::tstring, int > ( health ) + _T( " / " ) + lexical_cast< std::tstring, int > ( maxhealth ) );
}
}
catch(...)
{
//...laziness
}
}
Announcement
Collapse
No announcement yet.
TF2 Entity ESP
Collapse
X
-
TF2 Entity ESP
PHP Code:Tags: None
Comment