Advertisement
Guest User

Untitled

a guest
Aug 14th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. if (isPlayer)
  2. {
  3. int HEALTH = pEntity->m_Table->pTable->m_HpRow->Health;
  4. if (HEALTH <= 0)continue;
  5.  
  6. D3DXVECTOR3 PosEnt = pEntity->GetDecryptedEnemyPos(), Out;
  7.  
  8. float dist = DrawFunc::Distance3D(LocalPos.x, LocalPos.y, LocalPos.z, PosEnt.x, PosEnt.y, PosEnt.z);
  9. dist = dist / (70.0 / 1.8);
  10.  
  11. char dst[255];
  12. sprintf(dst, "[%2.fm]", dist);
  13.  
  14.  
  15. char strN[255];
  16. sprintf(strN, "%s", pEntity->m_Table->pTable->pNickName->Nickname);
  17.  
  18. Model* model_entity = 0;
  19. Animator* pAnimator_entity = 0;
  20. ModelSkeletal* ModelSkeletal_entity = 0;
  21. float mindist = 100000000;
  22.  
  23. for (auto model : pModelFac->pModelList)
  24. {
  25. if (!model)continue;
  26.  
  27. Animator* pAnimator = model->pAnimator;
  28. if (!pAnimator)continue;
  29.  
  30. ModelSkeletal* Skeletal = pAnimator->pModelSkeletal;
  31. if (!Skeletal)continue;
  32. if (!Skeletal->GetSpaceNode)continue;
  33.  
  34. if (strstr(model->pAnimator->CharacterType, "dataosha_female") == nullptr
  35. && strstr(model->pAnimator->CharacterType, "dataosha_male") == nullptr)continue;
  36.  
  37. D3DXVECTOR3 vec = (Skeletal->GetSpaceNode->Max2 + Skeletal->GetSpaceNode->Min2) / 2;
  38. float d = DrawFunc::Distance3D(vec.x, vec.y, vec.z, PosEnt.x, PosEnt.y, PosEnt.z);
  39. if (d < mindist)
  40. {
  41. mindist = d;
  42. model_entity = model;
  43. pAnimator_entity = pAnimator;
  44. ModelSkeletal_entity = Skeletal;
  45. }
  46. }
  47.  
  48. if (!model_entity)continue;
  49. if (!pAnimator_entity)continue;
  50. if (!ModelSkeletal_entity)continue;
  51. if (!ModelSkeletal_entity->GetSpaceNode)continue;
  52.  
  53. /*char tt[255];
  54. sprintf(tt, " model_entity: %x | minDist: %f", model_entity, mindist);
  55. OutputDebugString(tt);*/
  56.  
  57. DrawFunc::Skeleton(pGame, pAnimator_entity, model_entity, Color::colCyan, 2);
  58.  
  59. float w[4];
  60. if (DrawFunc::GetBoneEsp(PosEnt, ModelSkeletal_entity->GetSpaceNode->Max2, ModelSkeletal_entity->GetSpaceNode->Min2, w, pGame))
  61. {
  62. BGUI::DrawRect(w[0], w[1], w[2] - w[0], w[3] - w[1], 2, Color::colCyan);
  63. MENU::EspFont.Draw(strN, w[0] + (w[2] - w[0]) / 2.0 - MENU::EspFont.GetTextWidth(strN, 20) / 2.0, w[1] - 20, 20, Color::colCyan, 0, 0, 0);
  64. MENU::EspFont.Draw(dst, w[0] + (w[2] - w[0]) / 2.0 - MENU::EspFont.GetTextWidth(dst, 20) / 2.0, w[3], 20, Color::colCyan, 0, 0, 0);
  65. }
  66. }
  67. if (isRobot)
  68. {
  69. int HEALTH = pEntity->m_Table->pTable->m_Hpbot->Health;
  70. if (HEALTH <= 0)continue;
  71.  
  72. D3DXVECTOR3 Pos = pEntity->GetDecryptedEnemyPos(), Out;
  73.  
  74.  
  75. DrawFunc::Skeleton(pGame, pAnimator_entity, model_entity, Color::colCyan, 2);
  76.  
  77. char str2[255];
  78. sprintf(str2, "BOT[ %d ]", HEALTH);
  79.  
  80. if (pGame->WorldToScreen(&Pos, &Out))
  81. {
  82. MENU::EspFont.Draw(str2, Out.x, Out.y, 20, Color::colRed, 0, 0, 0);
  83. }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement