imGol2den

AW Structures TU4

Nov 26th, 2014
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.13 KB | None | 0 0
  1. // by imGol2den
  2. // credit to ryan and blackhacks
  3.  
  4. typedef struct Vector3
  5. {
  6.     FLOAT x, y, z;
  7.     Vector3()
  8.     { x = 0; y = 0; z = 0; }
  9.     Vector3(FLOAT x, FLOAT y, FLOAT z)
  10.     { this->x = x; this->y = y; this->z = z; }
  11.     BOOL operator== (Vector3 &Vector)
  12.     { return (this->x == Vector.x && this->y == Vector.y && this->z == Vector.z); }
  13.     Vector3& operator+ (Vector3 &Vector)
  14.     { return Vector3(this->x + Vector.x, this->y + Vector.y, this->z + Vector.z); }
  15.     Vector3& operator- (Vector3 &Vector)
  16.     { return Vector3(this->x - Vector.x, this->y - Vector.y, this->z - Vector.z); }
  17.     FLOAT Distance(Vector3 &Vector)
  18.         { return sqrt(DistanceEx(Vector)); }
  19.     FLOAT DistanceEx(Vector3 &Vector)
  20.     {
  21.         FLOAT _x = this->x - Vector.x, _y = this->y - Vector.y, _z = this->z - Vector.z;
  22.         return ((_x * _x) + (_y * _y) + (_z * _z));
  23.     }
  24.     FLOAT Dot(Vector3 &Other)
  25.     { return (this->x * Other.x)  +  (this->y * Other.y) + (this->z * Other.z); }
  26.     Vector3 &RoundHalfUp()
  27.     { return Vector3(floor(this->x + 0.5), floor(this->y + 0.5), floor(this->z + 0.5)); }\
  28.     Vector3 &RoundHalfDown()
  29.     { return Vector3(floor(this->x + 0.5), floor(this->y + 0.5), floor(this->z + 0.5)); }
  30. } Vector3, *PVector3;
  31.  
  32. typedef struct Vector2
  33. {
  34.     FLOAT x, y;
  35.  
  36.     Vector2()
  37.     { x = y = 0; }
  38.  
  39.     Vector2(FLOAT x, FLOAT y)
  40.     { this->x = x; this->y = y; }
  41.  
  42. } Vector2, *PVector2;
  43.  
  44. typedef struct cgs_t
  45. {
  46.     BYTE _0x0000[36];
  47.     BYTE Gametype[32]; // 0x0024
  48.     CHAR HostName[260]; // 0x0044
  49.     DWORD MaxClients; // 0x0148
  50.     DWORD PrivateClients; // 0x014C
  51.     CHAR Mapname[64]; // 0x0150
  52.     BYTE _0x0190[54100];
  53. } cgs_t, *pcgs_t; // size 0xD4E4
  54.  
  55. typedef struct usercmd_s
  56. {
  57.     DWORD ServerTime; // 0x0000
  58.     DWORD Buttons; // 0x0004
  59.     DWORD ViewAngles[3]; // 0x0008
  60.     CHAR _0x0014[48];
  61. } usercmd_s, *pusercmd_s; // size 0x44
  62. typedef struct clientActive_t
  63. {
  64.     BYTE _0x0000[248];
  65.     Vector3 Origin; // 0x00F8
  66.     BYTE _0x0104[12];
  67.     Vector3 SpawnAngles; // 0x0110
  68.     BYTE _0x011C[15436];
  69.     Vector3 ViewAngles; // 0x3D68
  70.     usercmd_s UserCommands[128]; // 0x3D74
  71.     DWORD CommandNumber; // 0x5F74
  72.     BYTE _0x5F78[42184];
  73.  
  74.     inline DWORD GetUserCommandNumber()
  75.     {
  76.         return CommandNumber & 0x7F;
  77.     }
  78.     inline pusercmd_s GetUserCommand(DWORD CommandNumber = -1)
  79.     {
  80.         if(CommandNumber == -1) { return &UserCommands[this->CommandNumber & 0x7F]; }
  81.         return &UserCommands[CommandNumber]; // # r10 = r11 & 0x7F
  82.     }
  83. } clientActive_t, *pclientActive_t; // size 0x10440
  84.  
  85. typedef struct centity_s
  86. {
  87.     BYTE _0x0000[20];
  88.     Vector3 Origin; // 0x0014
  89.     Vector3 Angles; // 0x0020
  90.     BYTE _0x002C[431];
  91.     BYTE State; // 0x01DB
  92.     BYTE _0x01DC[48];
  93. } centity_s, *pcentity_s; // size 0x020C
  94.  
  95. typedef struct clientInfo_t
  96. {
  97.     BYTE _0x0000[12];
  98.     DWORD Team; // 0x000C
  99.     BYTE _0x0010[3108];
  100. } clientInfo_t, *pclientInfo_t; // size 0x0C34
  101.  
  102. typedef struct cg_s
  103. {
  104.     BYTE ClientNumber; // 0x0000
  105.     BYTE _0x0000[75];
  106.     DWORD ServerTime; // 0x004C
  107.     BYTE _0x0050[10];
  108.     WORD PlayerStance; // 0x005A
  109.     BYTE _0x005C[28];
  110.     Vector3 Origin; // 0x0078
  111.     Vector3 Velocity; // 0x0084
  112.     BYTE _0x0090[344];
  113.     DWORD Health; // 0x01E8
  114.     BYTE _0x01EC[661324];
  115.     clientInfo_t clientInfo[18]; // 0xA1938
  116.     BYTE _0xAF4E0[71200];
  117. } cg_s, *pcg_s; // size 0xC0B00
Advertisement
Add Comment
Please, Sign In to add comment