Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void drawesp(IDirect3DDevice9* pDevice)
- {
- if (opt.options.reset)
- {
- dieForever();
- }
- int m_pWorld = Memory::ReadMemory<int>(BAddress + OFFSET_PYGAME + 0x410);
- int m_pSceneContext = Memory::ReadMemory<int>(m_pWorld + 0x8);
- int cameraBase = Memory::ReadMemory<int>(m_pSceneContext + 0x4);
- if (!Memory::ReadMemoryC<D3DXMATRIX>(cameraBase + 0xC4) && ingame == true)
- {
- //dieForever();
- ingame = false;
- }
- D3DXMATRIX worldMatrix = Memory::ReadMemory<D3DXMATRIX>(cameraBase + 0xC4);
- int visibleCount = Memory::ReadMemory<int>(m_pWorld + 0x278);// 'As CModelFactory->CModelSkeletal 0x28 '0x27c
- int pLocalModel = Memory::ReadMemory<int>(m_pWorld + 0x27C);
- int pSkeletonList = Memory::ReadMemory<int>(m_pWorld + 0x290);// 'As CModelFactory->CModelSkeletal 0x3C 'pSkeletonList 0x28c
- D3DXVECTOR3 vScreen;
- pDevice->GetViewport(&Viewport);
- int width = (int)Viewport.Width;
- int height = (int)Viewport.Height;
- int num1 = Memory::ReadMemory<int>(BAddress + OFFSET_LOCAL);
- int numnya = Memory::ReadMemory<int>(BAddress + 34);
- Vector3 MyPosition;
- auto pLocal = Memory::ReadMemory<int>(BAddress + 0x20EA28C);
- int x = Memory::ReadMemory<int>(pLocal + 16) ^ Memory::ReadMemory<int>(Memory::ReadMemory<int>(pLocal + 20));
- int y = Memory::ReadMemory<int>(pLocal + 24) ^ Memory::ReadMemory<int>(Memory::ReadMemory<int>(pLocal + 28));
- int z = Memory::ReadMemory<int>(pLocal + 32) ^ Memory::ReadMemory<int>(Memory::ReadMemory<int>(pLocal + 36));
- //MyPosition = Vector3 (*reinterpret_cast<float*>(&x)), *reinterpret_cast<float*>(&y), *reinterpret_cast<float*>(&z);
- ClientApper::LinkedList* pGameObjects = *reinterpret_cast<ClientApper::LinkedList**>(ClientApper::GetInstance()->m_ppObjects);
- if (!ClientApper::GetInstance()->m_ppObjects)
- printf("FAIL 1");
- if (!pGameObjects)
- {
- printf("FAIL 2");
- }
- UINT counter = 0;
- ClientApper::ListItem* pCurrentItem = pGameObjects->m_pStart;
- //entity loop @IChooseYou and @lucastx
- while (pCurrentItem && pCurrentItem != pGameObjects->m_pEnd)
- {
- for (int i = 0; i < visibleCount; i += 4)
- {
- int r_pModel = Memory::ReadMemory<int>(pSkeletonList + i);
- int SpaceNode = Memory::ReadMemory<int>(r_pModel + 0x1C);
- int m_pAnimator = Memory::ReadMemory<int>(r_pModel + 0x328);
- D3DXMATRIX m_Position = Memory::ReadMemory<D3DXMATRIX>(r_pModel + 0x3B0);
- string m_pModelName = Memory::ReadString(Memory::ReadMemory<int>(m_pAnimator + 0x528), 16);
- string str = m_pModelName;
- bool isPlayer = findnew(str, "character");
- bool Riffle_Ammo = findnew(str, "Rifle Ammo");
- bool isVehicle = findnew(str, "vehicle");// (str.find("Land") != std::string::npos);
- bool isBot = (std::string::npos != str.find("Robot"));
- bool isItem = (std::string::npos != str.find("DtsProp"));
- bool isSupplyBox = (std::string::npos != str.find("DtsPlayerHeritage"));
- bool isPlane = (std::string::npos != str.find("Plane"));
- bool isWeapon = (std::string::npos != str.find("ClientWeaponEntity"));
- bool isCar = (std::string::npos != str.find("LandCar"));
- bool isBicycle = (std::string::npos != str.find("LandBike"));
- bool isExpress = (std::string::npos != str.find("LandExpress"));
- bool isMotor = (std::string::npos != str.find("LandMotor"));
- bool isGlider = (std::string::npos != str.find("LandGlider"));
- bool isBoat = (std::string::npos != str.find("LandBoat"));
- bool isBattleGround = (std::string::npos != str.find("BattleGroundSpace"));
- D3DXVECTOR3 EnemyPos;
- Vector3 EnemyPos1;
- EnemyPos.x = m_Position[12];
- EnemyPos.y = m_Position[13];
- EnemyPos.z = m_Position[14]; // kung mararapatin pwede q ba mahinge yun sayo?
- if (i == 0)
- {
- MyPosition.x = EnemyPos.x;
- MyPosition.y = EnemyPos.y;
- MyPosition.z = EnemyPos.z;
- continue;
- }
- if (ClientApp::WorldToScreen(EnemyPos, vScreen, worldMatrix, width, height))
- {
- if (isPlayer)
- {
- if (opt.espopt.lines)
- {
- DrawLine1(pDevice, (float)(width / 2) - 1, 1, vScreen.x, vScreen.y, BLUE(255));
- }
- //DrawLine1(pDevice, vScreen.x, vScreen.y, width / 0.1, height - 15.0f, BLUE(255));
- float entityHeight = 21.5f;
- D3DXVECTOR3 pRoot;
- ClientApp::WorldToScreen(EnemyPos, pRoot, worldMatrix, width, height);
- D3DXVECTOR3 eHead;
- eHead.x = EnemyPos.x;
- eHead.y = EnemyPos.y + entityHeight;
- eHead.z = EnemyPos.z;
- float dist2 = GetDistance(MyPosition, EnemyPos1, 10);
- D3DXVECTOR3 pHead;
- ClientApp::WorldToScreen(eHead, pHead, worldMatrix, width, height);
- struct Rectangle
- {
- int width;
- int height;
- int X;
- int Y;
- };
- Rectangle rect;
- rect.width = (int)(700 / dist2);
- if (rect.width > 100)
- {
- rect.width = 100;
- }
- rect.height = (int)(pRoot.y - pHead.y);
- rect.X = (int)pRoot.x - rect.width / 2;
- rect.Y = (int)pRoot.y - rect.height;
- if (dist2 > 25)
- {
- rect.Y = (int)pRoot.y - rect.height + 15;
- }
- if (opt.espopt.box3)
- {
- D3DXVECTOR3 Pos0, Pos1, Pos2, Pos3, Pos4, Pos5, Pos6, Pos7, Pos8;
- D3DXVECTOR3 EnemyPos1 = EnemyPos;
- EnemyPos1.y -= 10;
- D3DXVECTOR3 eHead1 = eHead;
- eHead1.y += 10;
- Pos0 = GetMidPoint(eHead1, EnemyPos1);
- Pos1 = Pos0 + D3DXVECTOR3(-5, 17, -5);
- Pos2 = Pos0 + D3DXVECTOR3(-5, -17, -5);
- Pos3 = Pos0 + D3DXVECTOR3(5, -17, -5);
- Pos4 = Pos0 + D3DXVECTOR3(5, 17, -5);
- Pos5 = Pos0 + D3DXVECTOR3(-5, 17, 5);
- Pos6 = Pos0 + D3DXVECTOR3(-5, -17, 5);
- Pos7 = Pos0 + D3DXVECTOR3(5, -17, 5);
- Pos8 = Pos0 + D3DXVECTOR3(5, 17, 5);
- D3DXVECTOR3 bone1;
- D3DXVECTOR3 bone2;
- D3DXVECTOR3 bone3;
- D3DXVECTOR3 bone4;
- D3DXVECTOR3 bone5;
- D3DXVECTOR3 bone6;
- D3DXVECTOR3 bone7;
- D3DXVECTOR3 bone8;
- if (true)
- {
- if (ClientApp::WorldToScreen(Pos1, bone1, worldMatrix, width, height)
- && ClientApp::WorldToScreen(Pos2, bone2, worldMatrix, width, height)
- && ClientApp::WorldToScreen(Pos3, bone3, worldMatrix, width, height)
- && ClientApp::WorldToScreen(Pos4, bone4, worldMatrix, width, height)
- && ClientApp::WorldToScreen(Pos5, bone5, worldMatrix, width, height)
- && ClientApp::WorldToScreen(Pos6, bone6, worldMatrix, width, height)
- && ClientApp::WorldToScreen(Pos7, bone7, worldMatrix, width, height)
- && ClientApp::WorldToScreen(Pos8, bone8, worldMatrix, width, height))
- {
- DrawLine1(pDevice, bone1.x, bone1.y - 38, bone2.x, bone2.y - 38, D3DCOLOR_ARGB(255, 255, 255, 000));
- DrawLine1(pDevice, bone2.x, bone2.y - 38, bone3.x, bone3.y - 38, D3DCOLOR_ARGB(255, 255, 255, 000));
- DrawLine1(pDevice, bone3.x, bone3.y - 38, bone4.x, bone4.y - 38, D3DCOLOR_ARGB(255, 255, 255, 000));
- DrawLine1(pDevice, bone4.x, bone4.y - 38, bone1.x, bone1.y - 38, D3DCOLOR_ARGB(255, 255, 255, 000));
- DrawLine1(pDevice, bone5.x, bone5.y - 38, bone6.x, bone6.y - 38, D3DCOLOR_ARGB(255, 255, 255, 000));
- DrawLine1(pDevice, bone6.x, bone6.y - 38, bone7.x, bone7.y - 38, D3DCOLOR_ARGB(255, 255, 255, 000));
- DrawLine1(pDevice, bone7.x, bone7.y - 38, bone8.x, bone8.y - 38, D3DCOLOR_ARGB(255, 255, 255, 000));
- DrawLine1(pDevice, bone8.x, bone8.y - 38, bone5.x, bone5.y - 38, D3DCOLOR_ARGB(255, 255, 255, 000));
- DrawLine1(pDevice, bone1.x, bone1.y - 38, bone5.x, bone5.y - 38, D3DCOLOR_ARGB(255, 255, 255, 000));
- DrawLine1(pDevice, bone2.x, bone2.y - 38, bone6.x, bone6.y - 38, D3DCOLOR_ARGB(255, 255, 255, 000));
- DrawLine1(pDevice, bone3.x, bone3.y - 38, bone7.x, bone7.y - 38, D3DCOLOR_ARGB(255, 255, 255, 000));
- DrawLine1(pDevice, bone4.x, bone4.y - 38, bone8.x, bone8.y - 38, D3DCOLOR_ARGB(255, 255, 255, 000));
- }
- }
- }
- /*D3DXVECTOR3 ScreenBot;
- if (WorldToScreens(EnemyPos, vScreen, worldMatrix) && WorldToScreens(eHead, ScreenBot, worldMatrix))
- {
- if (opt.espopt.resizebox)
- {
- float B_Distance = GetDistancer(MyPosition, EnemyPos, 10);
- Box3D(pDevice, ScreenBot.x, ScreenBot.y, vScreen.x, vScreen.y, B_Distance, Menu.RED);
- }
- }*/
- int headradi;
- D3DXVECTOR2 scneck, schead;
- D3DXVECTOR3 vec3neck;
- D3DXVECTOR4 neck;
- D3DXVECTOR3 vec3head;
- //vec3head = Model.m_ModelSkeletal->m_pAnimator->GetBonePosition(neck, 14, Character->f_Yaw, Character->f_Pitch);
- //vec3neck = Model.m_ModelSkeletal->m_pAnimator->GetBonePosition(neck, 33, Character->f_Yaw, Character->f_Pitch);
- if (ClientApp::WorldToScreen(eHead, pHead, worldMatrix, width, height) && ClientApp::WorldToScreen(pHead, eHead, worldMatrix, width, height))
- {
- D3DXVECTOR3 Box = pHead - eHead;
- if (Box.y < 0) Box.y *= -1;
- headradi = (int)Box.y * 1.5;
- if (opt.espopt.bonehead)
- DrawCircle(eHead.x, eHead.y - (headradi + 2.3), 2.3 + headradi, RED(255), pDevice);
- }
- int Adress1 = Memory::ReadMemory<int>(Memory::ReadMemory<int>(BAddress + OFFSET_CLIENT) + m_pppObjects);
- int Adress2 = Memory::ReadMemory<int>(Memory::ReadMemory<int>(Memory::ReadMemory<int>(Memory::ReadMemory<int>(Adress1))));
- int Adress3 = Memory::ReadMemory<int>(Adress2 + 12);
- int PlayerHP = Memory::ReadMemory<int>(Memory::ReadMemory<int>(Memory::ReadMemory<int>(Memory::ReadMemory<int>(Adress3 + 256) + 20) + 152) + 8);
- if (isPlayer && opt.espopt.name && PlayerHP != 0)
- DrawString(Font, vScreen.x, vScreen.y - 20, RED(255), (PCHAR)"Player");
- D3DXVECTOR3 vHeadScreen(0, 0, 0);
- if (opt.espopt.boxer && ClientApp::WorldToScreen(eHead, vScreen, worldMatrix, width, height))
- {
- Box3D(pDevice, eHead.x, eHead.y, vScreen.x, vScreen.y, dist2, RED(255));
- }
- /*
- BOOL pEntityPlayer = Memory::ReadMemory<int>(Memory::ReadMemory<int>(BAddress + OFFSET_CLIENT) + m_ppObjects);
- pEntityPlayer = Memory::ReadMemory<int>(pEntityPlayer + 0x0);
- int pStart = Memory::ReadMemory<int>(Memory::ReadMemory<int>(Memory::ReadMemory<int>(Memory::ReadMemory<int>(pEntityPlayer))));
- int pEnd = Memory::ReadMemory<int>(pStart + 0x4);
- int Entity = Memory::ReadMemory<int>(pStart + 0xC);
- int Nickname = Memory::ReadMemory<int>(Memory::ReadMemory<int>(Memory::ReadMemory<int>(Memory::ReadMemory<int>(Entity + 0x100) + 0xC) + 0x8) + 0x14);
- char zPlayer[100];
- sprintf(zPlayer, "%s", Nickname);
- if (opt.espopt.nick)
- WriteText(pDevice, vScreen.x, vScreen.y, RED(255), zPlayer);
- */
- //DC YAN FIX MO KUNG GUSTO MO MAPAGANA
- // char* Nick = Client->m_pFirst->m_pStart->m_pEntity->m_pMeta->pName;
- // char zPlayer[100];
- // sprintf(zPlayer, "%s", Nick);
- // if (opt.espopt.nick)
- // WriteText(pDevice, vScreen.x, vScreen.y, RED(255), zPlayer);
- //POINT pt;
- if (opt.espopt.box2)
- Box2D(pHead, pRoot, GREEN(255), pDevice);
- // int PlayerHP = Client->m_pFirst->m_pEnd->m_pEntity->m_pTable->pTable->m_MaxHpRow->HP;
- //int PlayerHP = Client->m_pFirst->m_pStart->m_pEntity->m_pTable->pTable->m_HpRow->HP;
- //int num6 = 100;
- //int PlayerHP = 100;
- //int num6 = Memory::ReadMemory<int>(Memory::ReadMemory<int>(Memory::ReadMemory<int>(Memory::ReadMemory<int>(r_pModel + 256) + 20) + 152) + 8);
- char getHP[20];
- sprintf(getHP, "[%d]", PlayerHP);
- if (opt.espopt.healthtext)
- WriteText(pDevice, vScreen.x - 10, vScreen.y + 55, RED(255), getHP);
- char result[100] = "";
- sprintf(result, "Distance: %.1f m", (dist2));
- if (opt.espopt.dist)
- DrawString(Font, vScreen.x, vScreen.y - 10, WHITE(255), (PCHAR)result);
- if (isVehicle && opt.espopt.vehicle)
- DrawString(Font, vScreen.x, vScreen.y, RED(255), "CAR");
- char cardist[100] = "";
- sprintf(cardist, "Distance : %.1f m", (dist2));
- if (isVehicle && opt.espopt.vehicle)
- if (opt.espopt.vehicle)
- DrawString(Font, vScreen.x - 10.0f, vScreen.y + 15.0f, RED(255), cardist);
- /*
- Client->m_pFirst->m_pStart->m_pEntity->Vals;
- Client->m_UnkObjectCount;
- Client->m_pFirst->m_pEnd->m_pEntity->m_ObjectId;
- */
- char* PlayerName = Client->m_pFirst->m_pStart->m_pEntity->m_pMeta->pName;
- sprintf(PlayerName, "%i", (dist2));
- if (opt.espopt.name)
- WriteText(pDevice, vScreen.x, vScreen.y, RED(255), PlayerName);
- if (opt.espopt.rainbow)
- {
- Healthbar(pDevice, vScreen.x - 50, vScreen.y + 25, (int)PlayerHP, false);
- }
- if (opt.espopt.health)
- {
- if (PlayerHP >= 100)
- {
- DrawString(Font, vScreen.x - 10, vScreen.y + 15, GREEN(255), (PCHAR)"▪▪▪▪▪▪▪▪▪▪");
- }
- if (PlayerHP >= 90)
- {
- DrawString(Font, vScreen.x - 10, vScreen.y + 15, GREEN(255), (PCHAR)"▪▪▪▪▪▪▪▪▪");
- }
- if (PlayerHP >= 80)
- {
- DrawString(Font, vScreen.x - 10, vScreen.y + 15, YELLOW(255), (PCHAR)"▪▪▪▪▪▪▪▪");
- }
- if (PlayerHP >= 70)
- {
- DrawString(Font, vScreen.x - 10, vScreen.y + 15, YELLOW(255), (PCHAR)"▪▪▪▪▪▪▪");
- }
- if (PlayerHP >= 60)
- {
- DrawString(Font, vScreen.x - 10, vScreen.y + 15, ORANGE(255), (PCHAR)"▪▪▪▪▪▪");
- }
- if (PlayerHP >= 50)
- {
- DrawString(Font, vScreen.x - 10, vScreen.y + 15, ORANGE(255), (PCHAR)"▪▪▪▪▪");
- }
- if (PlayerHP >= 40)
- {
- DrawString(Font, vScreen.x - 10, vScreen.y + 15, GREY(255), (PCHAR)"▪▪▪▪");
- }
- if (PlayerHP >= 30)
- {
- DrawString(Font, vScreen.x - 10, vScreen.y + 15, GREY(255), (PCHAR)"▪▪▪");
- }
- if (PlayerHP >= 20)
- {
- DrawString(Font, vScreen.x - 10, vScreen.y + 15, RED(255), (PCHAR)"▪▪");
- }
- if (PlayerHP >= 10)
- {
- DrawString(Font, vScreen.x - 10, vScreen.y + 15, RED(255), (PCHAR)"▪");
- }
- }
- else
- if (isBot && opt.espopt.player)
- DrawString(font, vScreen.x, vScreen.y, GREEN(255), (PCHAR)"BOT");
- if (opt.espopt.type)
- {
- DrawString(Font, vScreen.x, vScreen.y, PINK(255), (PCHAR)str.c_str());
- }
- else
- if (isItem && opt.espopt.item)
- {
- // int cliententitytable = reinterpret_cast<UINT_PTR>(Client->m_ppObjects + 0x100);
- //int cliententitytable = *Memory::ReadMemory<ClientApper::LinkedList**>(Client->m_ppObjects + 0x100);
- // int cliententitytableptr = Memory::ReadMemory<int>(cliententitytable + 0x14);
- // int propID = Memory::ReadMemory<int>(Memory::ReadMemory<int>(cliententitytableptr + 0x2C) + 0x8);
- //string itemName;
- //if (itemName == "Ghillie Suit" || itemName == "SMG QD-EX-Mag" || itemName == "8x Scope" || itemName == "4x Scope" || itemName == "SR EX-QD-Mag" || itemName == "Rifle EX-QD-Mag" || itemName == "RPG Ammo" || itemName == "SR Ammo" || itemName == "Rifle Ammo" || itemName == "SMG Silencer" || itemName == "SR Silence" || itemName == "Rifle Silencer" || itemName == "AUG Rifle" || itemName == "M110 Sniper Rifle" || itemName == "SVD SR" || itemName == "Thompson SMG" || itemName == "M14EBR Rifle" || itemName == "Lv 3 helmet" || itemName == "Lv 3 Armor" || itemName == "Lv 3 Backpack" || itemName == "First Aid Kit" || itemName == "Med Kit" || itemName == "Bandage" || itemName == "M4A1 Rifle" || itemName == "AKM Rifle" || itemName == "AWM SR" || itemName == "Barett SR")
- if (Riffle_Ammo && opt.espopt.item)
- DrawString(Font, vScreen.x, vScreen.y, YELLOW(255), (PCHAR)"Rifle Ammo");//getitemname(propID)); //(PCHAR)str.c_str()/*getitemname(propID)*/);
- }
- else
- if (isVehicle && opt.espopt.vehicle)
- {
- DrawString(Font, vScreen.x, vScreen.y, BLUE(255), (PCHAR)"VEHICLE");
- }
- else
- if (isWeapon &&opt.espopt.item)
- DrawString(Font, vScreen.x, vScreen.y, BLACK(100), (PCHAR)"WEAPON");
- }
- counter++;
- pCurrentItem = pCurrentItem->m_pNext;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement