LPDIRECT3DDEVICE9 gpDevice;
BOOL WorldToScreen(D3DXVECTOR3 vWorld, D3DXVECTOR3 *Position){
D3DVIEWPORT9 ViewPort = { 0 };
D3DXMATRIX Projection, View, World;
gpDevice->GetTransform(D3DTS_VIEW, &View);
gpDevice->GetTransform(D3DTS_PROJECTION, &Projection);
gpDevice->GetTransform(D3DTS_WORLD, &World);
gpDevice->GetViewport(&ViewPort);
D3DXVec3Project(Position, &vWorld, &ViewPort, &Projection, &View, &World);
if (Position->z < 1.0f){
return TRUE;
}
return FALSE;
}
gpDevice = pDevice;
bool isFilterPVPClient( int *hObj, void *user )
{
for( int i = 0; i < VAL_PLAYERCOUNT; i++ )
if( hObj == pESP->Players[ i ].getEntityIterator( )->Object )
return hObj;
return hObj;
}
void CSilentAim::setPVPIntersectSegment( void )
{
this->iQuery->Start = pESP->Players[ pAimbot->getIndex( ) ].getHeadPos( ) + D3DXVECTOR3( 0.0f, 50.0f, 0.0f );
this->iQuery->End = pESP->Players[ pAimbot->getIndex( ) ].getHeadPos( ) - D3DXVECTOR3( 0.0f, 50.0f, 0.0f );
this->iQuery->Flags = INTERSECT_OBJECTS | INTERSECT_HPOLY | IGNORE_NONSOLID;
this->iQuery->FilterFn = isFilterPVPClient;
this->bIntersectSegment = OIntersectSegment( *iQuery, qInfo );
if( this->bIntersectSegment )
{
this->qInfo->hObjImpact = pESP->Players[ pAimbot->getIndex( ) ].getEntityIterator( )->Object;
this->qInfo->vImpactPos = pESP->Players[ pAimbot->getIndex( ) ].getHeadPos( );
}
}
void CSilentAim::startSilentAim( void )
{
if( !this->bStatus )
return;
if( !( pAimbot->getStatus( ) && pAimbot->getIndex( ) ) )
return;
this->setPVPIntersectSegment( );
}
bool hkIntersectSegment( CIntersectQuery *iQuery, CIntersectInfo *qInfo )
{
CSilentAim objSilentAim = CSilentAim( iQuery, qInfo );
objSilentAim.setSilentStatus( Var::Aimbot::Silent );
objSilentAim.startSilentAim( );
return OIntersectSegment( *iQuery, qInfo );
}
class cLTCharacterFX
{
public:
char pad_0000[0x204]; //0x0000
char IsDead; //0x204
char pad_0208[0xF]; //0x0205
char IsVulnerable; //0x0214
char pad_0218[0x49667]; //0x0215
unsigned char CurrentWeapon; //0x4987C
};
if (Weapon) {
DWORD pWeaponMgr = *(DWORD*)WeaponMgr;
DWORD dwep = *(DWORD*)(pWeaponMgr + 4 * pPlayer->CharacterFX->CurrentWeapon);
if (dwep != NULL) {
cWeapon* wep = (cWeapon*)(*(DWORD*)(pWeaponMgr + 4 * pPlayer->CharacterFX->CurrentWeapon));
if ((wep != NULL) && (strlen(wep->Name) > 1)) {
aDrawText(Body.x - (GetTextWidth(wep->Name, pFont) / 2), Body.y + 50, wep->Name, BRANCO);
}
}
}
#define MAX_WEAPONS 2400 //Pega o Index da ultima arma no WeaponLog (2400 apenas para teste)
...
CurrentWeapon = Jogadores[Index].pJogador->pJogadorInfo->CurrentWeapon;
...
if ( CurrentWeapon >= 0 && CurrentWeapon < MAX_WEAPONS)
{
sprintf_s(Weapon, "%s", pEngine->GetWeaponName(CurrentWeapon));
}