QuestionESP is not working correctly

Posts 19 of 9 · Page 1 of 1
ESP is not working correctly
Hey Infestationcoder :P
I really need help from you.

I have this code to draw red dots for player, and white dots for vehicles:

Code:
void Draw(){
	//=======================================================================
	//Local Player
	//=======================================================================
	DWORD LocalPlayerAddress;
	D3DXVECTOR3 LocalPlayerPos;
	LocalPlayerAddress = memory.read<DWORD>(GetGame() + LocalPlayerOffset);
	LocalPlayerAddress ^= LocalPlayerXOR;
	LocalPlayerPos =  memory.read<D3DXVECTOR3 >(LocalPlayerAddress + locationAddress);

	//=======================================================================
	//Objects + Zombies
	//=======================================================================

	CGameWorld gw = memory.read<CGameWorld>(GetGameWorld());

	int maxObjects = gw.GetMaxObjects(); 


	for(int x = 0; x < maxObjects; x++){

		D3DCOLOR color = NULL;

		DWORD objAddress = memory.read<int>(gw.GetObject(x));
	
		
		D3DXVECTOR3 pvPos  = memory.read<D3DXVECTOR3 >(objAddress + locationAddress);
		D3DXVECTOR3 pvOut;
		if(300 >= getDistance(LocalPlayerPos, pvPos)){
			if(World2Screen(pvPos, &pvOut)){
				
				if (memory.read<int>(objAddress + ObjectManagerID) == PLAYER)
					DrawFilledBox(pvOut.x, pvOut.y, 4, 4, 204, 46, 46, 200);
				else if  (memory.read<int>(objAddress + ObjectManagerID) == OBJTYPE_VEHICLE)
					DrawFilledBox(pvOut.x, pvOut.y, 4, 4, 204, 255, 255, 255);
				
	}
		}
}
Its working.
But now, i want to draw a box instead of the FilledBox.
So i made this:

Code:
void DrawPlayerBox(int x, int y, int w, int h, int borderPx, int r, int g, int b, int a) {
	DrawFilledBox(x - (w / 2), (y - h + borderPx), w, borderPx, r, g, b, a); //bottom 
	DrawFilledBox(x - (w / 2), (y - h + borderPx), borderPx, h, r, g, b, a); //left 
	DrawFilledBox(x - (w / 2), y, w, borderPx, r, g, b, a); //top 
	DrawFilledBox((x + w - borderPx) - (w / 2), (y - h + borderPx), borderPx, h, r, g, b, a);//right 
}
And changed the code below to:

Code:
void Draw(){
	//=======================================================================
	//Local Player
	//=======================================================================
	DWORD LocalPlayerAddress;
	D3DXVECTOR3 LocalPlayerPos;
	LocalPlayerAddress = memory.read<DWORD>(GetGame() + LocalPlayerOffset);
	LocalPlayerAddress ^= LocalPlayerXOR;
	LocalPlayerPos =  memory.read<D3DXVECTOR3 >(LocalPlayerAddress + locationAddress);

	//=======================================================================
	//Objects + Zombies
	//=======================================================================

	CGameWorld gw = memory.read<CGameWorld>(GetGameWorld());

	int maxObjects = gw.GetMaxObjects(); 


	for(int x = 0; x < maxObjects; x++){

		D3DCOLOR color = NULL;

		DWORD objAddress = memory.read<int>(gw.GetObject(x));
	
		
		D3DXVECTOR3 pvPos  = memory.read<D3DXVECTOR3 >(objAddress + locationAddress);
		D3DXVECTOR3 pvOut;
		if(300 >= getDistance(LocalPlayerPos, pvPos)){
			if(World2Screen(pvPos, &pvOut)){
				
				if (memory.read<int>(objAddress + ObjectManagerID) == PLAYER)
					float dx = LocalPlayerPos.x - pvPos.x;
				float dy = LocalPlayerPos.y - pvPos.y;
				float dz = LocalPlayerPos.z - pvPos.z;
				float DistancePlayer = (float)sqrt((dx * dx) + (dy * dy) + (dz * dz));
				float fWidth = (60.0f * 15.0f) / DistancePlayer;
				float fHeight = (100.0f * 15.0f) / DistancePlayer;
				float fHeightMod = (500.0f / DistancePlayer);
				DrawPlayerBox(pvOut.x, pvOut.y, fWidth, fHeight, 1, 0, 204, 0, 255);
				else if  (memory.read<int>(objAddress + ObjectManagerID) == OBJTYPE_VEHICLE)
					DrawFilledBox(pvOut.x, pvOut.y, 4, 4, 204, 255, 255, 255);
				
	}
		}
}
But now ALL objects ingame are shown as a Box. Zombies, Player and Vehicles.
I saw this:
Code:
CGameWorld gw = memory.read<CGameWorld>(GetGameWorld());
This could be the reason why it shows me all objects, but then i dont know why the red dot only shows me the player..

Okay. Now i have this region in code which is made ONLY for player:

Code:
ClientGame gc = memory.read<ClientGame>(GetGame());

	for (int x = 0; x < 128; x++){

		DWORD objAddress = (DWORD)gc.GetPlayerByIndex(x);

		if (memory.read<int>(objAddress + ObjectManagerID) == PLAYER){
			D3DXVECTOR3 pvPos = memory.read<D3DXVECTOR3 >(objAddress + locationAddress);
			D3DXVECTOR3 pvOut;
			if (World2Screen(pvPos, &pvOut)){

				// Draw everything for the players here
				
				float dx = LocalPlayerPos.x - pvPos.x;
				float dy = LocalPlayerPos.y - pvPos.y;
				float dz = LocalPlayerPos.z - pvPos.z;
				float DistancePlayer = (float)sqrt((dx * dx) + (dy * dy) + (dz * dz));
				float fWidth = (60.0f * 15.0f) / DistancePlayer;
				float fHeight = (100.0f * 15.0f) / DistancePlayer;
				float fHeightMod = (500.0f / DistancePlayer);
				DrawPlayerBox(pvOut.x, pvOut.y, fWidth, fHeight, 1, 0, 204, 0, 255);
			}

		}

	}
But if i do this, i don´t see anything, so the code isn´t working.
What is wrong with the second code which is made for player only?
And why do i see all objects with the PlayerBox, but only player with the red FilledBox?
Im German, so sorry for my bad English.
I hope you can help me
If you want to see it (Teamviewer) add me in skype: SawMister
Best regards, René
Nice! If you want you can checkout my post with Chams and D3D that may help
No it´s not nice its a problem
I would love you if you can tell me what is wrong in the second code, because i don´t need chams :P
Regards, SawMister
I have no idea what you are wanting to do ...
I hope they see this
Regards, René
//================================================== =====================
//Players
//================================================== =====================


ClientGame gc = memory.read<ClientGame>(GetGame());

for (int x = 0; x < 128; x++){

DWORD objAddress = (DWORD)gc.GetPlayerByIndex(x);

if (memory.read<int>(objAddress + ObjectManagerID) == PLAYER){
D3DXVECTOR3 pvPos = memory.read<D3DXVECTOR3 >(objAddress + locationAddress);
D3DXVECTOR3 pvOut;
if (World2Screen(pvPos, &pvOut)){

//Draw everything for the players here
float dx = LocalPlayerPos.x - pvPos.x;
float dy = LocalPlayerPos.y - pvPos.y;
float dz = LocalPlayerPos.z - pvPos.z;
float DistancePlayer = (float)sqrt((dx * dx) + (dy * dy) + (dz * dz));
float fWidth = (60.0f * 15.0f) / DistancePlayer;
float fHeight = (100.0f * 15.0f) / DistancePlayer;
float fHeightMod = (500.0f / DistancePlayer);
DrawPlayerBox(pvOut.x, pvOut.y, fWidth, fHeight, 1, 0, 204, 0, 255);
}

}

}
This code should work. Whats wrong with it?
It doesn´t show me players
Quote Originally Posted by SawMister View Post
This code should work. Whats wrong with it?
It doesn´t show me players
for (int x = 0; x < 128; x++)

128 is ?
Its the max user value on a server. This class is outdated but should work. Whats the new maximum player value on a server?
But i think this will not fix the problem :S
Posts 19 of 9 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?