I'm having an issue with ESP. I am D/C'ing as soon as I activate it 0.o. This is my current code:
My classes and w2s-
Code:
class PointerTo;
class PlayerInfo;
class _Object;
class CILTDrawPrim;
class PointerTo
{
public:
char pad[4];
PlayerInfo * first;
__int32 index;
};
class PlayerInfo
{
public:
__int32 Unknown0; //0000
__int32 index; //0004
__int32 Unknown2; //0008
__int32 Unknown3; //000C
char Name[12]; //0010
char unknown5[12];
_Object* obj; //0028
char unknown7[76];
__int8 IsDead; //0078
__int8 Unknown9; //0079
__int16 Unknown10; //007A
char unknown11[488];
PlayerInfo* Next; //0264
};
class _Object
{
public:
char Pad[4];
D3DXVECTOR3 origin;
};
class CILTDrawPrim
{
public:
virtual void function0(); //
virtual void function1(); //
virtual void function2(); //
virtual void function3(); //
virtual void function4(); //
virtual void function5(); //
virtual void function6(); //
virtual void function7(); //
virtual void function8(); //
virtual void function9(); //
virtual void function10(); //
virtual void function11(); //
virtual void function12(); //
virtual void function13(); //
virtual void function14(); //
virtual void function15(); //
virtual void function16(); //
virtual void function17(); //
virtual void function18(); //
virtual void function19(); //
virtual void function20(); //
virtual void function21(); //
virtual void function22(); //
virtual void function23(); //
virtual void function24(); //
virtual void function25(); //
virtual void function26(); //
virtual void function27(); //
virtual void function28(); //
virtual void function29(); //
virtual void function30(); //
virtual void function31(); //
virtual void function32(); //
virtual void function33(); //
virtual void function34(); //
virtual void function35(); //
virtual void function36(); //
virtual void function37(); //
virtual void function38(); //
virtual void function39(); //
virtual void function40(); //
virtual void function41(); //
virtual void function42(); //
virtual void function43(); //
virtual void function44(); //
virtual void function45(); //
virtual void function46(); //
virtual void function47(); //
virtual void function48(); //
virtual void function49(); //
virtual HRESULT Project( float x, float y, float z, D3DXVECTOR3* pProjectOut, D3DXVECTOR3* pTransformOut); //
char unknown[17232]; //0x0004
D3DXMATRIX World; //0x4354
D3DXMATRIX View; //0x4394
D3DXMATRIX Projection; //0x43D4
};//Size=0x4414(17428)
bool WorldToScreen(PlayerInfo* pPlayer, D3DXVECTOR3 * pOut )
{
D3DVIEWPORT9 viewPort = {0};
pDevice->GetViewport(&viewPort);
D3DXVECTOR3 vWorld(pPlayer->obj->origin.x ,pPlayer->obj->origin.y, pPlayer->obj->origin.z);
CILTDrawPrim* pDrawPrim = *(CILTDrawPrim**)0x7FF010;
D3DXVec3Project( pOut, &vWorld, &viewPort, &pDrawPrim->Projection, &pDrawPrim->View, &pDrawPrim->World );
return ( pOut->z < 1.0f );
}
YES, these are a c+p from the release thread, no need to point that out.
Then the nametags-
Code:
typedef PlayerInfo* (__thiscall *lpGetPlayerByIndex)(unsigned long ulThis,int index, int unk);
lpGetPlayerByIndex GetPlayerByIndex;
GetPlayerByIndex = (lpGetPlayerByIndex)(0x3715DD10);
unsigned long ulThis = *(unsigned long*)(0x3780A0A8);
char *szFormat = new char[ 256 ];
if(*(int*)0x3781886C == 1) {
for ( int i = 0; i < 16; i++ )
{
PlayerInfo* pPlayer = GetPlayerByIndex( ulThis,i,0);
sprintf(szFormat,"%s",pPlayer->Name);
D3DXVECTOR3 Position;
if(WorldToScreen(pPlayer, &Position))
{
DrawText(Position.x, Position.y-60,Red,szFormat, pDevice);
}
}}
I started using the check for ingame as an attempt to fix this issue.
Now, I disconnect when I join a game...
I have checked, and it seems all addresses used are correct.
Are the public classes released here out of date?
IF this has anything to do with it, here is the DrawText function I am using-
Code:
void DrawText(int x,int y,DWORD color,char *text, LPDIRECT3DDEVICE9 pDevice){
RECT rect;
SetRect( &rect, x, y, x, y );
d3dfont->DrawTextA(NULL,text,-1,&rect, DT_LEFT|DT_NOCLIP, color);
}
I have tried everything, and I am perplexed as to why this is not working.
Thanks in advance.