Advertisement
Guest User

Untitled

a guest
May 16th, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.83 KB | None | 0 0
  1. #include "stdafx.h"
  2. #ifndef PROCMEM_H
  3. #define PROCMEM_H
  4. #include <Windows.h>
  5. #include <stdbool.h>
  6. typedef struct
  7. {
  8.     float flMatrix[4][4];
  9. }WorldToScreenMatrix_t;
  10.  
  11. float Get3dDistance(float * myCoords, float * enemyCoords)
  12.  
  13.  
  14.  
  15. {}
  16. bool WorldToScreen(float * from, float * to)
  17. {
  18.     WorldToScreenMatrix_t WorldToScreenMatrix;
  19.     float w = 0.0f;
  20.  
  21.     to[0] = WorldToScreenMatrix.flMatrix[0][0] * from[0] + WorldToScreenMatrix.flMatrix[0][1] * from[1] + WorldToScreenMatrix.flMatrix[0][2] * from[2] + WorldToScreenMatrix.flMatrix[0][3];
  22.     to[1] = WorldToScreenMatrix.flMatrix[1][0] * from[0] + WorldToScreenMatrix.flMatrix[1][1] * from[1] + WorldToScreenMatrix.flMatrix[1][2] * from[2] + WorldToScreenMatrix.flMatrix[1][3];
  23.     w = WorldToScreenMatrix.flMatrix[3][0] * from[0] + WorldToScreenMatrix.flMatrix[3][1] * from[1] + WorldToScreenMatrix.flMatrix[3][2] * from[2] + WorldToScreenMatrix.flMatrix[3][3];
  24.  
  25.     if (w < 0.01f)
  26.         return false;
  27.  
  28.     float invw = 1.0f / w;
  29.     to[0] *= invw;
  30.     to[1] *= invw;
  31.  
  32.     int width = (int) (rc.right - rc.left);
  33.     int height = (int) (rc.bottom - rc.top);
  34.  
  35.     float x = width / 2;
  36.     float y = height / 2;
  37.  
  38.     x += 0.5 * to[0] * width + 0.5;
  39.     y -= 0.5 * to[1] * height + 0.5;
  40.  
  41.     to[0] = x + rc.left;
  42.     to[1] = y + rc.top;
  43.  
  44.     return true;
  45. }
  46.  
  47. void DrawBone(int bone1, int bone2)
  48. {
  49.     float Bone1[3];
  50.     float W2S_Bone1[3];
  51.    
  52.     ;
  53.  
  54.     float Bone2[3];
  55.     float W2S_Bone2[3];
  56.  
  57.     if (WorldToScreen(Bone2, W2S_Bone2) && WorldToScreen(Bone1, W2S_Bone1))
  58.  
  59.        
  60.     (W2S_Bone1[0], W2S_Bone1[1], W2S_Bone2[0], W2S_Bone2[1], 255, 255, 255, 255);
  61. }
  62. bool ESP = true;
  63. bool callOnce = false;
  64. int Render()
  65. {
  66.  
  67.     if (!callOnce)
  68.     {
  69.         callOnce = true;
  70.     }
  71.  
  72.     int tWnd;
  73.     float GetForegroundWindow;
  74.     if (tWnd == ESP())
  75.     {
  76.         char * value = "RainbowSixGame";
  77. HWND newhwnd = FindWindow(NULL, value);
  78.         if (newhwnd != NULL) {
  79.         }
  80.         else {
  81.         }
  82.  
  83.  
  84.         for (int i = 0; i < 64; i++)
  85.         {
  86.             pEntity->ReadData(i);
  87.  
  88.    
  89.             float W2S[3];
  90.             float W2S_Head[3];
  91.             if (WorldToScreen(pEntity->Pos, W2S) && WorldToScreen(pEntity->HeadPos, W2S_Head));
  92.             {
  93.                
  94.                 int height = abs(W2S[1] - W2S_Head[1]);
  95.                 int width = height / 2;
  96.  
  97.                                
  98.                 if (pEntity->isAlive && pLocal->Player != pEntity->Player)
  99.                 {
  100.                     //Check if the player is in our team
  101.                     if (pEntity->Team == pLocal->Team)
  102.                         DrawBox(W2S[0] - (width / 2), W2S[1] - height, width, height, 1, 0, 0, 255, 255);
  103.                     else//Check if the player is not in our team
  104.                         DrawBox(W2S[0] - (width / 2), W2S[1] - height, width, height, 1, 255, 0, 0, 255);
  105.  
  106.                     //Outline and inline boxes
  107.                     DrawBox(W2S[0] - (width / 2) - 1, W2S[1] - height - 1, width + 2, height + 2, 1, 0, 0, 0, 255);
  108.                     DrawBox(W2S[0] - (width / 2) + 1, W2S[1] - height + 1, width - 2, height - 2, 1, 0, 0, 0, 255);
  109.             }
  110.         }
  111.     }
  112.  
  113.     p_Device->EndScene();
  114.     p_Device->PresentEx(0, 0, 0, 0, 0);
  115.     return 0;
  116. }
  117. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement