Advertisement
ryonadv

RedEyeCheats SA:MP v0.3.0 b1g c1t frt

Sep 19th, 2018
1,769
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 72.47 KB | None | 0 0
  1. // CHEAT BY RYON.SiLENT
  2. //HOOK BY GAM
  3. //PASTREAZA CREDITELE SAU 7 ANI DE GHINION P@
  4. #include <windows.h>
  5. #include <d3d9.h>
  6. #include "imgui.h"
  7. #include "imgui_impl_dx9.h"
  8. #include "vtable.h"
  9. #include "main.h"
  10. #include <d3dx9.h>
  11. #pragma comment(lib, "d3d9.lib")
  12. #pragma comment(lib, "d3dx9.lib")
  13.  
  14. #define sleep Sleep
  15. #define D3D_VFUNCTIONS 119
  16. #define DEVICE_PTR 0xC97C28
  17. #define ENDSCENE_INDEX 42
  18. #define RESET_INDEX 16
  19. #define SAMP_CHAT_INFO_OFFSET 0x21A0E4
  20. #define SAMP_INFO  0x21A0F8
  21. #define SAMP_SETTINGS  0x3C5
  22. #define SAMP_FUNC_SAY                               0x57F0
  23. #define SAMP_FUNC_SENDCMD                           0x65C60
  24. #define M_PI 3.14159265358979323846
  25. #define PILOT_ADDR                                  0x96914C
  26. #define DEFCOLOR_SRC(name, r, g, b) \
  27.     static Color name## (uint8_t a = 240){ return Color (r, g, b, a); }
  28.  
  29.  
  30. //SISTEMUL DE HWID A FOST SCOS, NU TREBUIE SA-L INLOCUIESTI
  31. #define eu -629155318
  32.  
  33.  
  34. class Color {
  35. public:
  36.  
  37.     Color() {
  38.         SetColor(0, 0, 0, 255);
  39.     }
  40.  
  41.     Color(uint8_t r, uint8_t g, uint8_t b) {
  42.         SetColor(r, g, b, 255);
  43.     }
  44.  
  45.     Color(uint8_t r, uint8_t g, uint8_t b, uint8_t a) {
  46.         SetColor(r, g, b, a);
  47.     }
  48.  
  49.     void SetColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255) {
  50.         _color[0] = (uint8_t)r;
  51.         _color[1] = (uint8_t)g;
  52.         _color[2] = (uint8_t)b;
  53.         _color[3] = (uint8_t)a;
  54.     }
  55.  
  56.     void GetColor(uint8_t &r, uint8_t &g, uint8_t &b, uint8_t &a) const {
  57.         r = _color[0];
  58.         g = _color[1];
  59.         b = _color[2];
  60.         a = _color[3];
  61.     }
  62.  
  63.     uint8_t &operator[](int index) {
  64.         return _color[index];
  65.     }
  66.  
  67.     const uint8_t &operator[](int index) const {
  68.         return _color[index];
  69.     }
  70.  
  71.     bool operator == (const Color &rhs) const {
  72.         return (*((int *)this) == *((int *)&rhs));
  73.     }
  74.  
  75.     bool operator != (const Color &rhs) const {
  76.         return !(operator==(rhs));
  77.     }
  78.  
  79.     int r() { return _color[0]; }
  80.     int g() { return _color[1]; }
  81.     int b() { return _color[2]; }
  82.     int a() { return _color[3]; }
  83.  
  84.     int GetR() { return _color[0]; }
  85.     int GetG() { return _color[1]; }
  86.     int GetB() { return _color[2]; }
  87.     int GetA() { return _color[3]; }
  88.  
  89.     void SetR(uint8_t _i) { _color[0] = _i; }
  90.     void SetG(uint8_t _i) { _color[1] = _i; }
  91.     void SetB(uint8_t _i) { _color[2] = _i; }
  92.     void SetA(uint8_t _i) { _color[3] = _i; }
  93.  
  94.     Color &operator=(const Color &rhs) {
  95.         *(int*)(&_color[0]) = *(int*)&rhs._color[0];
  96.         return *this;
  97.     }
  98.  
  99.     Color operator+(const Color &rhs) const {
  100.         int red = _color[0] + rhs._color[0];
  101.         int green = _color[1] + rhs._color[1];
  102.         int blue = _color[2] + rhs._color[2];
  103.         int alpha = _color[3] + rhs._color[3];
  104.  
  105.         red = red > 255 ? 255 : red;
  106.         green = green > 255 ? 255 : green;
  107.         blue = blue > 255 ? 255 : blue;
  108.         alpha = alpha > 255 ? 255 : alpha;
  109.  
  110.         return Color(red, green, blue, alpha);
  111.     }
  112.  
  113.     Color operator-(const Color &rhs) const {
  114.         int red = _color[0] - rhs._color[0];
  115.         int green = _color[1] - rhs._color[1];
  116.         int blue = _color[2] - rhs._color[2];
  117.         int alpha = _color[3] - rhs._color[3];
  118.  
  119.         red = red < 0 ? 0 : red;
  120.         green = green < 0 ? 0 : green;
  121.         blue = blue < 0 ? 0 : blue;
  122.         alpha = alpha < 0 ? 0 : alpha;
  123.         return Color(red, green, blue, alpha);
  124.     }
  125.  
  126.     operator const uint8_t*() {
  127.         return (uint8_t*)(&_color[0]);
  128.     }
  129.  
  130.     static Color FromHSB(float hue, float saturation, float brightness)
  131.     {
  132.         float h = hue == 1.0f ? 0 : hue * 6.0f;
  133.         float f = h - (int)h;
  134.         float p = brightness * (1.0f - saturation);
  135.         float q = brightness * (1.0f - saturation * f);
  136.         float t = brightness * (1.0f - (saturation * (1.0f - f)));
  137.  
  138.         if (h < 1)
  139.         {
  140.             return Color(
  141.                 (unsigned char)(brightness * 255),
  142.                 (unsigned char)(t * 255),
  143.                 (unsigned char)(p * 255)
  144.             );
  145.         }
  146.         else if (h < 2)
  147.         {
  148.             return Color(
  149.                 (unsigned char)(q * 255),
  150.                 (unsigned char)(brightness * 255),
  151.                 (unsigned char)(p * 255)
  152.             );
  153.         }
  154.         else if (h < 3)
  155.         {
  156.             return Color(
  157.                 (unsigned char)(p * 255),
  158.                 (unsigned char)(brightness * 255),
  159.                 (unsigned char)(t * 255)
  160.             );
  161.         }
  162.         else if (h < 4)
  163.         {
  164.             return Color(
  165.                 (unsigned char)(p * 255),
  166.                 (unsigned char)(q * 255),
  167.                 (unsigned char)(brightness * 255)
  168.             );
  169.         }
  170.         else if (h < 5)
  171.         {
  172.             return Color(
  173.                 (unsigned char)(t * 255),
  174.                 (unsigned char)(p * 255),
  175.                 (unsigned char)(brightness * 255)
  176.             );
  177.         }
  178.         else
  179.         {
  180.             return Color(
  181.                 (unsigned char)(brightness * 255),
  182.                 (unsigned char)(p * 255),
  183.                 (unsigned char)(q * 255)
  184.             );
  185.         }
  186.     }
  187.  
  188.     ImU32 GetU32()
  189.     {
  190.         return ((_color[3] & 0xff) << 24) + ((_color[2] & 0xff) << 16) + ((_color[1] & 0xff) << 8)
  191.             + (_color[0] & 0xff);
  192.         //return (ImU32)(((_color[3] & 0xff) << 24) + ((_color[0] & 0xff) << 16) + ((_color[1] & 0xff) << 8) + (_color[2] & 0xff));
  193.     }
  194.  
  195.     DEFCOLOR_SRC(Black, 0, 0, 0);
  196.     DEFCOLOR_SRC(White, 255, 255, 255);
  197.     DEFCOLOR_SRC(Red, 255, 0, 0);
  198.     DEFCOLOR_SRC(Green, 0, 255, 0);
  199.     DEFCOLOR_SRC(Blue, 0, 0, 255);
  200.     DEFCOLOR_SRC(Lime, 0, 255, 0);
  201.     DEFCOLOR_SRC(Yellow, 255, 255, 0);
  202.     DEFCOLOR_SRC(Cyan, 0, 255, 255);
  203.     DEFCOLOR_SRC(Magenta, 255, 0, 255);
  204.     DEFCOLOR_SRC(Silver, 192, 192, 192);
  205.     DEFCOLOR_SRC(Gray, 128, 128, 128);
  206.     DEFCOLOR_SRC(Maroon, 128, 0, 0);
  207.     DEFCOLOR_SRC(Olive, 128, 128, 0);
  208.     DEFCOLOR_SRC(Purple, 128, 0, 128);
  209.     DEFCOLOR_SRC(Teal, 0, 128, 128);
  210.     DEFCOLOR_SRC(Navy, 0, 0, 128);
  211.     DEFCOLOR_SRC(DarkRed, 139, 0, 0);
  212.     DEFCOLOR_SRC(Brown, 165, 42, 42);
  213.     DEFCOLOR_SRC(Firebrick, 178, 34, 34);
  214.     DEFCOLOR_SRC(Crimson, 220, 20, 60);
  215.     DEFCOLOR_SRC(IndianRed, 205, 92, 92);
  216.     DEFCOLOR_SRC(LightCoral, 240, 128, 128);
  217.     DEFCOLOR_SRC(DarkSalmon, 233, 150, 122);
  218.     DEFCOLOR_SRC(Salmon, 250, 128, 114);
  219.     DEFCOLOR_SRC(LightSalmon, 255, 160, 122);
  220.     DEFCOLOR_SRC(OrangeRed, 255, 69, 0);
  221.     DEFCOLOR_SRC(DarkOrange, 255, 140, 0);
  222.     DEFCOLOR_SRC(Orange, 255, 165, 0);
  223.     DEFCOLOR_SRC(Gold, 255, 215, 0);
  224.     DEFCOLOR_SRC(DarkGoldenRod, 184, 134, 11);
  225.     DEFCOLOR_SRC(GoldenRod, 218, 165, 32);
  226.     DEFCOLOR_SRC(YellowGreen, 154, 205, 50);
  227.     DEFCOLOR_SRC(DarkOliveGreen, 85, 107, 47);
  228.     DEFCOLOR_SRC(OliveDrab, 107, 142, 35);
  229.     DEFCOLOR_SRC(LawnGreen, 124, 252, 0);
  230.     DEFCOLOR_SRC(ChartReuse, 127, 255, 0);
  231.     DEFCOLOR_SRC(GreenYellow, 173, 255, 47);
  232.     DEFCOLOR_SRC(DarkGreen, 0, 100, 0);
  233.     DEFCOLOR_SRC(ForestGreen, 34, 139, 34);
  234.     DEFCOLOR_SRC(LimeGreen, 50, 205, 50);
  235.     DEFCOLOR_SRC(DarkCyan, 0, 139, 139);
  236.     DEFCOLOR_SRC(Aqua, 0, 255, 255);
  237.     DEFCOLOR_SRC(LightCyan, 224, 255, 255);
  238.     DEFCOLOR_SRC(DarkTurquoise, 0, 206, 209);
  239.     DEFCOLOR_SRC(Turquoise, 64, 224, 208);
  240.     DEFCOLOR_SRC(MediumTurquoise, 72, 209, 204);
  241.     DEFCOLOR_SRC(PaleTurquoise, 175, 238, 238);
  242.     DEFCOLOR_SRC(Aquamarine, 127, 255, 212);
  243.     DEFCOLOR_SRC(PowderBlue, 176, 224, 230);
  244.     DEFCOLOR_SRC(DodgerBlue, 30, 144, 255);
  245.     DEFCOLOR_SRC(Lightblue, 173, 216, 230);
  246.     DEFCOLOR_SRC(SkyBlue, 135, 206, 235);
  247.     DEFCOLOR_SRC(LightSkyBlue, 135, 206, 250);
  248.     DEFCOLOR_SRC(MidnightBlue, 25, 25, 112);
  249.     DEFCOLOR_SRC(DarkBlue, 0, 0, 139);
  250.     DEFCOLOR_SRC(MediumBlue, 0, 0, 205);
  251.     DEFCOLOR_SRC(RoyalBlue, 65, 105, 225);
  252.     DEFCOLOR_SRC(BlueViolet, 138, 43, 226);
  253.     DEFCOLOR_SRC(Indigo, 75, 0, 130);
  254.     DEFCOLOR_SRC(DarkSlateBlue, 72, 61, 139);
  255.     DEFCOLOR_SRC(SlateBlue, 106, 90, 205);
  256.     DEFCOLOR_SRC(MediumSlateBlue, 123, 104, 238);
  257.     DEFCOLOR_SRC(MediumPurple, 147, 112, 219);
  258.     DEFCOLOR_SRC(Darkmagenta, 139, 0, 139);
  259.     DEFCOLOR_SRC(Darkviolet, 148, 0, 211);
  260.     DEFCOLOR_SRC(DarkGray, 169, 169, 169);
  261.     DEFCOLOR_SRC(LightGray, 211, 211, 211);
  262.     DEFCOLOR_SRC(Gainsboro, 220, 220, 220);
  263.     DEFCOLOR_SRC(LtBlue, 0, 150, 255);
  264.     DEFCOLOR_SRC(LtGreen, 0, 255, 100);
  265. private:
  266.     uint8_t _color[4];
  267. };
  268. struct Color2
  269. {
  270.     int r;
  271.     int g;
  272.     int b;
  273.     int a;
  274.  
  275.     Color2()
  276.     {
  277.         this->r = 0;
  278.         this->g = 0;
  279.         this->b = 0;
  280.         this->a = 255;
  281.     }
  282.  
  283.     Color2(int r, int g, int b)
  284.     {
  285.         this->r = r;
  286.         this->g = g;
  287.         this->b = b;
  288.         this->a = 255;
  289.     }
  290.  
  291.     Color2(int r, int g, int b, int a)
  292.     {
  293.         this->r = r;
  294.         this->g = g;
  295.         this->b = b;
  296.         this->a = a;
  297.     }
  298.  
  299.     Color2 operator / (float div)
  300.     {
  301.         Color2 color = *this;
  302.         color.r = color.r / div;
  303.         color.g = color.g / div;
  304.         color.b = color.b / div;
  305.         return color;
  306.     }
  307.  
  308.     Color2& operator /= (float div)
  309.     {
  310.         Color2& color = *this;
  311.         color.r /= div;
  312.         color.g /= div;
  313.         color.b /= div;
  314.         return color;
  315.     }
  316.  
  317.     Color2& operator *= (float coeff)
  318.     {
  319.         Color2& color = *this;
  320.         color.r *= coeff;
  321.         color.g *= coeff;
  322.         color.b *= coeff;
  323.         return color;
  324.     }
  325.  
  326.     static Color2 FromHSB(float hue, float saturation, float brightness)
  327.     {
  328.         float h = hue == 1.0f ? 0 : hue * 6.0f;
  329.         float f = h - (int)h;
  330.         float p = brightness * (1.0f - saturation);
  331.         float q = brightness * (1.0f - saturation * f);
  332.         float t = brightness * (1.0f - (saturation * (1.0f - f)));
  333.  
  334.         if (h < 1)
  335.         {
  336.             return Color2(
  337.                 (unsigned char)(brightness * 255),
  338.                 (unsigned char)(t * 255),
  339.                 (unsigned char)(p * 255)
  340.             );
  341.         }
  342.         else if (h < 2)
  343.         {
  344.             return Color2(
  345.                 (unsigned char)(q * 255),
  346.                 (unsigned char)(brightness * 255),
  347.                 (unsigned char)(p * 255)
  348.             );
  349.         }
  350.         else if (h < 3)
  351.         {
  352.             return Color2(
  353.                 (unsigned char)(p * 255),
  354.                 (unsigned char)(brightness * 255),
  355.                 (unsigned char)(t * 255)
  356.             );
  357.         }
  358.         else if (h < 4)
  359.         {
  360.             return Color2(
  361.                 (unsigned char)(p * 255),
  362.                 (unsigned char)(q * 255),
  363.                 (unsigned char)(brightness * 255)
  364.             );
  365.         }
  366.         else if (h < 5)
  367.         {
  368.             return Color2(
  369.                 (unsigned char)(t * 255),
  370.                 (unsigned char)(p * 255),
  371.                 (unsigned char)(brightness * 255)
  372.             );
  373.         }
  374.         else
  375.         {
  376.             return Color2(
  377.                 (unsigned char)(brightness * 255),
  378.                 (unsigned char)(p * 255),
  379.                 (unsigned char)(q * 255)
  380.             );
  381.         }
  382.     }
  383.  
  384.     static Color2 FromImColor(ImColor color)
  385.     {
  386.         return Color2(
  387.             (int)(color.Value.x * 255),
  388.             (int)(color.Value.y * 255),
  389.             (int)(color.Value.z * 255),
  390.             (int)(color.Value.w * 255)
  391.         );
  392.     }
  393.  
  394.  
  395.     static ImColor ToImColor(Color2 color)
  396.     {
  397.         return ImColor(
  398.             color.r / 255.f,
  399.             color.g / 255.f,
  400.             color.b / 255.f,
  401.             color.a / 255.f
  402.         );
  403.     }
  404.  
  405. };
  406.  
  407.  
  408. extern HINSTANCE hAppInstance;
  409.  
  410. UCHAR szFileSys[255], szVolNameBuff[255];
  411. DWORD dwMFL, dwSysFlags;
  412. DWORD dwSerial;
  413. LPCTSTR szHD = "C:\\";
  414.  
  415. HINSTANCE HThisModule;
  416. bool DoUnload;
  417.  
  418. typedef HRESULT(__stdcall* _EndScene)(IDirect3DDevice9* pDevice);
  419. _EndScene oEndScene;
  420.  
  421. typedef long(__stdcall* _Reset)(IDirect3DDevice9* pDevice, D3DPRESENT_PARAMETERS* pp);
  422. _Reset oReset = nullptr;
  423.  
  424.  
  425. bool RainbowHud = false;
  426. static float misc_RainbowSpeed;
  427. int rrspeed;
  428. bool culoare_pusa;
  429. bool rainbowmenu = false;
  430. bool defaulttheme = false;
  431.  
  432. bool slapper = false;
  433.  
  434. bool gamespeedmenu = false;
  435.  
  436. int setfakeping;
  437. bool fake_ping = false;
  438. bool teleportmap = false;
  439. bool teleportcp = false;
  440. bool upside = false;
  441. bool bEditFootSync = false;
  442. bool ghostmode = false;
  443. bool tintarainbow = false;
  444. bool RainbowRadar = false;
  445.  
  446.  
  447. bool rainbowcarlight = false;
  448. bool fakepingmenu = false;
  449. bool timemenu = false;
  450. bool wallhackmenu = false;
  451. bool rainbowmenu2 = false;
  452. bool weathermenu = false;
  453.  
  454. bool pilot = false;
  455.  
  456. bool atentat1 = false;//e c mortii lui de c++
  457. bool tick_done;
  458. DWORD tick;
  459. float fWeaponDamage[55] =
  460. {
  461.     82.5, // 0 - fist
  462.     1.0, // 1 - Brass knuckles
  463.     1.0, // 2 - Golf club
  464.     1.0, // 3 - Nitestick
  465.     1.0, // 4 - Knife
  466.     1.0, // 5 - Bat
  467.     1.0, // 6 - Shovel
  468.     1.0, // 7 - Pool cue
  469.     1.0, // 8 - Katana
  470.     1.0, // 9 - Chainsaw
  471.     1.0, // 10 - Dildo
  472.     1.0, // 11 - Dildo 2
  473.     1.0, // 12 - Vibrator
  474.     1.0, // 13 - Vibrator 2
  475.     1.0, // 14 - Flowers
  476.     1.0, // 15 - Cane
  477.     82.5, // 16 - Grenade
  478.     0.0, // 17 - Teargas
  479.     1.0, // 18 - Molotov
  480.     9.9, // 19 - Vehicle M4 (custom)
  481.     46.2, // 20 - Vehicle minigun (custom)
  482.     0.0, // 21
  483.     8.25, // 22 - Colt 45
  484.     13.2, // 23 - Silenced
  485.     46.2, // 24 - Deagle
  486.     49.5,//3.3, // 25 - Shotgun
  487.     49.5,//3.3, // 26 - Sawed-off
  488.     39.6,//4.95, // 27 - Spas
  489.     6.6, // 28 - UZI
  490.     8.25, // 29 - MP5
  491.     9.900001, // 30 - AK47
  492.     9.900001, // 31 - M4
  493.     6.6, // 32 - Tec9
  494.     24.750001, // 33 - Cuntgun
  495.     41.25, // 34 - Sniper
  496.     82.5, // 35 - Rocket launcher
  497.     82.5, // 36 - Heatseeker
  498.     1.0, // 37 - Flamethrower
  499.     46.2, // 38 - Minigun
  500.     82.5, // 39 - Satchel
  501.     0.0, // 40 - Detonator
  502.     0.33, // 41 - Spraycan
  503.     0.33, // 42 - Fire extinguisher
  504.     0.0, // 43 - Camera
  505.     0.0, // 44 - Night vision
  506.     0.0, // 45 - Infrared
  507.     0.0, // 46 - Parachute
  508.     0.0, // 47 - Fake pistol
  509.     2.64, // 48 - Pistol whip (custom)
  510.     9.9, // 49 - Vehicle
  511.     330.0, // 50 - Helicopter blades
  512.     82.5, // 51 - Explosion
  513.     1.0, // 52 - Car park (custom)
  514.     1.0, // 53 - Drowning
  515.     165.0 // 54 - Splat
  516. };
  517. bool OnSendPacket(BitStream *parameters, PacketPriority priority, PacketReliability reliability, char orderingChannel)
  518. {
  519.     uint8_t packetId;
  520.     stOnFootData OnFootData;
  521.     parameters->ResetReadPointer();
  522.     parameters->Read(packetId);
  523.     parameters->Read((char *)&OnFootData, sizeof(stOnFootData));
  524.     switch (packetId)
  525.     {
  526.     case ID_PLAYER_SYNC:
  527.  
  528.         if (ghostmode)
  529.         {
  530.             bEditFootSync = true;
  531.             //stOnFootData OnFootData;
  532.             //memcpy(&OnFootData, &g_Players->pLocalPlayer->onFootData, sizeof(stOnFootData));
  533.             OnFootData.byteSpecialAction = 3;
  534.             //parameters->Reset();
  535.             //parameters->Write((BYTE)ID_PLAYER_SYNC);
  536.             //parameters->Write((PCHAR)&OnFootData, sizeof(stOnFootData));
  537.             //g_RakFuncs->Send(parameters, HIGH_PRIORITY, UNRELIABLE_SEQUENCED, 0);
  538.         }
  539.  
  540.  
  541.         if (upside)
  542.         {
  543.             bEditFootSync = true;
  544.  
  545.             D3DXQUATERNION Quat, Quat2;
  546.             Quat.w = OnFootData.fQuaternion[0];
  547.             Quat.x = OnFootData.fQuaternion[1];
  548.             Quat.y = OnFootData.fQuaternion[2];
  549.             Quat.z = OnFootData.fQuaternion[3];
  550.             //
  551.             D3DXVECTOR3 Axis;
  552.             Axis.x = 0;
  553.             Axis.y = 1;
  554.             Axis.z = 0;
  555.             D3DXQuaternionRotationAxis(&Quat2, &Axis, M_PI);
  556.             D3DXQuaternionMultiply(&Quat, &Quat, &Quat2);
  557.             OnFootData.fQuaternion[0] = Quat.w;
  558.             OnFootData.fQuaternion[1] = Quat.x;
  559.             OnFootData.fQuaternion[2] = Quat.y;
  560.             OnFootData.fQuaternion[3] = Quat.z;
  561.  
  562.         }
  563.         if (bEditFootSync)
  564.         {
  565.             parameters->Reset();
  566.             parameters->Write((BYTE)ID_PLAYER_SYNC);
  567.             parameters->Write((PCHAR)&OnFootData, sizeof(stOnFootData));
  568.             pSAMP->sendPacket(parameters);
  569.             bEditFootSync = false;
  570.         }
  571.         if (atentat1)
  572.         {
  573.  
  574.             if (!tick_done)
  575.             {
  576.                 tick = GetTickCount64();
  577.                 tick_done = true;
  578.             }
  579.             if (GetTickCount64() - tick > 700)
  580.             {
  581.                 static int current_tick = 1;
  582.  
  583.                 stBulletData BulletData;
  584.                 parameters->ResetReadPointer();
  585.                 parameters->Read(packetId);
  586.                 parameters->Read((PCHAR)&BulletData, sizeof(stBulletData));
  587.  
  588.                 int weaponid = pSAMP->getPlayers()->pLocalPlayer->byteCurrentWeapon;
  589.  
  590.                 for (int i = 0; i < SAMP_MAX_PLAYERS; i++)
  591.                 {
  592.                     if (pSAMP->getPlayers()->pRemotePlayer[i] == nullptr)
  593.                         continue;
  594.                     if (pSAMP->getPlayers()->pRemotePlayer[i]->pPlayerData == nullptr)
  595.                         continue;
  596.                     if (!pSAMP->getPlayers()->pRemotePlayer[i]->pPlayerData->fActorHealth)
  597.                         continue;
  598.                     float damage_t = pSAMP->getPlayers()->pRemotePlayer[i]->pPlayerData->fActorHealth / fWeaponDamage[pSAMP->getPlayers()->pLocalPlayer->byteCurrentWeapon];
  599.  
  600.  
  601.                     for (int z = 0; z < round(damage_t) + 1; z++)
  602.                     {
  603.                         BulletData.byteType = 1;
  604.                         BulletData.fOrigin[0] = pSAMP->getPlayers()->pRemotePlayer[i]->pPlayerData->fOnFootPos[0];
  605.                         BulletData.fOrigin[1] = pSAMP->getPlayers()->pRemotePlayer[i]->pPlayerData->fOnFootPos[1];
  606.                         BulletData.fOrigin[2] = pSAMP->getPlayers()->pRemotePlayer[i]->pPlayerData->fOnFootPos[2];
  607.  
  608.                         BulletData.fTarget[0] = pSAMP->getPlayers()->pRemotePlayer[i]->pPlayerData->fOnFootPos[0];
  609.                         BulletData.fTarget[1] = pSAMP->getPlayers()->pRemotePlayer[i]->pPlayerData->fOnFootPos[1];
  610.                         BulletData.fTarget[2] = pSAMP->getPlayers()->pRemotePlayer[i]->pPlayerData->fOnFootPos[2];
  611.  
  612.                         if (pSAMP->getPlayers()->pRemotePlayer[i]->pPlayerData->bytePlayerState == PLAYER_STATE_ONFOOT)
  613.                         {
  614.                             BulletData.fCenter[0] = (1.0f / 2) - ((rand() % (int)(1.0f * 10.0f) / 100.0f));
  615.                             BulletData.fCenter[1] = (1.0f / 2) - ((rand() % (int)(1.0f * 10.0f) / 100.0f));
  616.                             BulletData.fCenter[2] = 0.50f - ((rand() % 100) / 100.0f);
  617.                         }
  618.  
  619.                         else
  620.                         {
  621.                             BulletData.fCenter[0] = 0.0f;
  622.                             BulletData.fCenter[1] = 0.0f;
  623.                             BulletData.fCenter[2] = 0.56f - ((rand() % 5) / 100.0f);
  624.                         }
  625.                         BulletData.sTargetID = i;
  626.                         BulletData.byteWeaponID = weaponid;
  627.                         BitStream bsGiveDamage;
  628.                         bsGiveDamage.Write(false);
  629.                         bsGiveDamage.Write((USHORT)i);
  630.                         bsGiveDamage.Write((float)fWeaponDamage[weaponid]);
  631.                         bsGiveDamage.Write((int)weaponid);
  632.                         bsGiveDamage.Write((rand() % 7) + 3);
  633.                         pSAMP->sendRPC(RPC_GiveTakeDamage, &bsGiveDamage, HIGH_PRIORITY, RELIABLE_SEQUENCED, NULL, false);
  634.  
  635.  
  636.                         parameters->Reset();
  637.                         parameters->Write((BYTE)ID_BULLET_SYNC);
  638.                         parameters->Write((PCHAR)&BulletData, sizeof(stBulletData));
  639.                         pSAMP->sendPacket(parameters);
  640.                     }
  641.  
  642.  
  643.                 }
  644.  
  645.                 tick = 0;
  646.                 tick_done = false;
  647.             }
  648.         }
  649.     }
  650.     return TRUE;
  651. }
  652.  
  653. bool normalaim = false;
  654. bool nop = false;
  655. bool mp5checked = false;
  656. bool akchecked = false;
  657. bool sniperchecked = false;
  658. bool minigunchecked = false;
  659. bool silencedchecked = false;
  660. bool shotgunchecked = false;
  661. bool riflechecked = false;
  662. bool tecchecked = false;
  663. bool combatchecked = false;
  664. bool m4a1checked = false;
  665. bool deaglechecked = false;
  666. bool aimbotmenu = false;
  667. bool panic = false;
  668.  
  669.  
  670. //stuff
  671.  
  672. const char stunanims[12][15]
  673. {
  674.     "DAM_armL_frmBK",
  675.     "DAM_armL_frmFT",
  676.     "DAM_armL_frmLT",
  677.     "DAM_armR_frmBK",
  678.     "DAM_armR_frmFT",
  679.     "DAM_armR_frmRT",
  680.     "DAM_LegL_frmBK",
  681.     "DAM_LegL_frmFT",
  682.     "DAM_LegL_frmLT",
  683.     "DAM_LegR_frmBK",
  684.     "DAM_LegR_frmFT",
  685.     "DAM_LegR_frmRT"
  686. };
  687. const char stunanims2[4][18]
  688. {
  689.     "DAM_stomach_frmBK",
  690.     "DAM_stomach_frmFT",
  691.     "DAM_stomach_frmLT",
  692.     "DAM_stomach_frmRT"
  693. };
  694.  
  695.  
  696. char namechanger[256];
  697. bool namech = false;
  698.  
  699. int state = 0;
  700. bool checkpoint = false;
  701.  
  702. bool spawnme = false;
  703. int cheat_spammer_delay = 1;
  704. bool cheat_enable_spammer = false;
  705. char cheat_spammer_text[256];
  706. bool bAntiStun = false;
  707. bool bAntiStunned = false;
  708. bool taim = false;
  709. bool weather = false;
  710. int timeset;
  711. int weatherset;
  712. int tabb = 1;
  713. int whsize = 5;
  714. bool wall = false;
  715. BYTE* infRun = (BYTE*)0xB7CEE4;
  716. bool c_infRun = false;
  717. BYTE* GodMode = (BYTE*)0x96916D;
  718. bool c_GodMode = false;
  719. bool ioxygen = false;
  720. bool watercarvar = false;
  721. bool fake_kick = false;
  722. bool tp = false;
  723. bool megajumpvar = false;
  724. bool Trigger = false;
  725. //bool cnormal = false;
  726. bool mousefixvar = false;
  727. //nitro car
  728. bool nitrocar = false;
  729.  
  730. //tankmode
  731. bool tankmodecar = false;
  732. bool thermalvisionvar = false;
  733. bool aimbotvar = false;
  734. bool rotationvar = false;
  735. bool infammovar = false;
  736. bool fpsunlockvar = false;
  737. BYTE* bjump = (BYTE*)0x969161;
  738. bool c_bjump = false;
  739. BYTE* bfall = (BYTE*)0x969161;
  740. bool c_bfall = false;
  741.  
  742. bool gamespeedvar1 = false;
  743. int setgamespeed;
  744.  
  745. bool c_cnormal = false;
  746. static bool no_resize = false;
  747. bool c_norecoil = false;
  748. bool KeyPressed(BYTE key)
  749. {
  750.     return ((GetAsyncKeyState(key)&(1 << 16)) != 0);
  751. }
  752.  
  753. DWORD* pInfo = NULL;
  754. BYTE* ThroughWalls = NULL;
  755. float* fDistance = NULL;
  756. DWORD gpoint;
  757. int t = 0;
  758. int keyt;
  759. float fcxpos;
  760. float fcypos;
  761. float camxpos;
  762. float fpvectorx;
  763. float fpvectory;
  764. float fxpos1;
  765. float fypos1;
  766. float fxpos2;
  767. float fypos2;
  768. float fxpos2a;
  769. float fypos2a;
  770. float fphp;
  771. float aa;
  772. float ab;
  773. float ac;
  774. float beta;
  775. float alpha;
  776. float fFps = NULL;
  777. float fLastTickCount = NULL;
  778. float fCurrentTickCount;
  779. float centerX = 0.0f;
  780. float centerY = 0.0f;
  781. float resX = 0.0f;
  782. float resY = 0.0f;
  783.  
  784. LONG x;
  785. LONG y;
  786. POINT pos;
  787. DWORD php;
  788. DWORD xpos1;
  789. DWORD ypos1;
  790. DWORD xpos2;
  791. DWORD ypos2;
  792. DWORD pmtrx1;
  793. DWORD pmtrx2;
  794. DWORD pvectorx;
  795. DWORD pvectory;
  796. DWORD ptarget;
  797. DWORD pped;
  798. DWORD pId;
  799. DWORD dwOldProtect = 0;
  800.  
  801.  
  802. DWORD* pTarget = (DWORD*)0xB6F3B8;//pointer of target object.
  803. DWORD* pActor = (DWORD*)0xB6F5F0;//pointer of player actor
  804. DWORD* pCamera = (DWORD*)0xB6F99C;//camera pointer
  805. float* camXpos = (float*)0xB6F258;//writeable camera Z angle
  806. int smooth_aim = 0;
  807. //stuff
  808.  
  809. // nu il mai gasesc pan
  810. bool g_bwasInitialized = false;
  811. bool m_IsGameFullyLoaded = false;
  812. bool menuOpen = false;
  813. bool wndproc = false;
  814. bool* p_open = NULL;
  815. bool recon = false;
  816. int item = 0;
  817. int startstop;
  818. int close;
  819. int hwndd;
  820. int startmenu;
  821.  
  822. DWORD key;
  823. HMODULE samp = GetModuleHandleA("samp.dll");
  824. DWORD address = (DWORD)samp + 0x64230;
  825. DWORD procID;
  826. DWORD g_dwSAMP_Addr = NULL;
  827. DWORD *g_Chat = NULL;
  828. HANDLE handle;
  829. HWND hWnd;
  830.  
  831. WNDPROC oriWndProc = NULL;
  832. extern LRESULT ImGui_ImplDX9_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
  833.  
  834. void everything()
  835. {
  836.     GetWindowThreadProcessId(hWnd, &procID);
  837.     handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procID);
  838. }
  839.  
  840. //stuff
  841.  
  842.  
  843. void addSayToChatWindow(char *msg)
  844. {
  845.     if (pSAMP == NULL)
  846.         return;
  847.  
  848.     if (msg == NULL)
  849.         return;
  850.  
  851.     if (msg == NULL)
  852.         return;
  853.  
  854.     if (msg[0] == '/')
  855.     {
  856.         ((void(__thiscall *) (void *_this, char *message)) (g_dwSAMP_Addr + SAMP_FUNC_SENDCMD))(pSAMP->getInput(), msg);
  857.     }
  858.     else
  859.     {
  860.         ((void(__thiscall *) (void *_this, char *message)) (g_dwSAMP_Addr + SAMP_FUNC_SAY)) (pSAMP->getPlayers()->pLocalPlayer, msg);
  861.     }
  862. }
  863.  
  864. void say(char *text, ...)
  865. {
  866.     if (pSAMP == NULL)
  867.         return;
  868.  
  869.     if (text == NULL)
  870.         return;
  871.  
  872.     va_list ap;
  873.     char    tmp[128];
  874.     memset(tmp, 0, 128);
  875.  
  876.     va_start(ap, text);
  877.     vsprintf(tmp, text, ap);
  878.     va_end(ap);
  879.  
  880.     addSayToChatWindow(tmp);
  881. }
  882.  
  883. void MouseFix()
  884. {
  885.     float xaxis;
  886.     float yaxis;
  887.     ReadProcessMemory(handle, (PBYTE*)0xB6EC1C, &xaxis, 4, 0);
  888.     ReadProcessMemory(handle, (PBYTE*)0xB6EC18, &yaxis, 4, 0);
  889.     if (xaxis != yaxis)
  890.     {
  891.         WriteProcessMemory(handle, (LPVOID)0xB6EC18, &xaxis, 4, 0);
  892.     }
  893. }
  894.  
  895. // LCN
  896. int setLocalPlayerName(const char *name)
  897. {
  898.     if (pSAMP->getPlayers() == NULL || pSAMP->getPlayers()->pLocalPlayer == NULL)
  899.         return 0;
  900.  
  901.     int strlen_name = strlen(name);
  902.     if (strlen_name == 0 || strlen_name > SAMP_ALLOWED_PLAYER_NAME_LENGTH)
  903.         return 0;
  904.  
  905.     ((void(__thiscall *) (void *, const char *name, int len)) (g_dwSAMP_Addr + 0xB290)) (&pSAMP->getPlayers()->pVTBL_txtHandler, name, strlen_name);
  906.     return 1;
  907. }
  908. //
  909.  
  910. void Fakekick()
  911. {
  912.     if (fake_kick)
  913.     {
  914.         unsigned int func = (unsigned int)GetModuleHandleA("samp.dll") + 0x58C0;//g_dwSAMP_Addr + 0x4D70
  915.         __asm {
  916.             PUSH 00
  917.             PUSH 0xFFFF
  918.             CALL func
  919.         }
  920.     }
  921. }
  922.  
  923. void Functions()
  924. {
  925.  
  926.     if (slapper)
  927.     {
  928.         if (!tick_done)
  929.         {
  930.             tick = GetTickCount64();
  931.             tick_done = true;
  932.         }
  933.  
  934.         if (GetAsyncKeyState(VK_F12))
  935.         {
  936.  
  937.             if (GetTickCount64() - tick > 100) // every 100 ms + 5´meter height
  938.             {
  939.  
  940.                 DWORD ped = *(DWORD*)(0xB6F5F0);
  941.  
  942.  
  943.  
  944.                 DWORD matrix = *(DWORD*)(ped + 0x14);
  945.                 float *zcrd = (float*)(matrix + 0x38);
  946.  
  947.  
  948.                 float zcrd2 = *(float*)(matrix + 0x38);
  949.  
  950.                 *zcrd = zcrd2 + 6.0f;
  951.  
  952.                 tick_done = false;
  953.             }
  954.  
  955.         }
  956.  
  957.     }
  958.  
  959.     if (fake_ping)
  960.     {
  961.         DWORD fakeping = 1;
  962.         ReadProcessMemory(handle, (LPVOID)((DWORD)samp + 0xEC0A8), &fakeping, sizeof(fakeping), 0);
  963.  
  964.         if (fakeping != setfakeping)
  965.         {
  966.             fakeping = setfakeping;
  967.             WriteProcessMemory(handle, (LPVOID)((DWORD)samp + 0xEC0A8), &fakeping, sizeof(fakeping), 0);
  968.         }
  969.     }
  970.     if (!fake_ping)
  971.     {
  972.         DWORD fakeping = 1;
  973.         ReadProcessMemory(handle, (LPVOID)((DWORD)samp + 0xEC0A8), &fakeping, sizeof(fakeping), 0);
  974.  
  975.         if (fakeping != 100)
  976.         {
  977.             fakeping = 100;
  978.             WriteProcessMemory(handle, (LPVOID)((DWORD)samp + 0xEC0A8), &fakeping, sizeof(fakeping), 0);
  979.         }
  980.     }
  981.  
  982.     if (teleportcp)
  983.     {
  984.         if (GetAsyncKeyState(VK_F11) & 1)
  985.         {
  986.             int cpx, cpy, cpz, cped, matrix, cpon;
  987.             ReadProcessMemory(handle, (LPVOID)0xC7DEC8, &cpx, sizeof(cpx), NULL);
  988.             ReadProcessMemory(handle, (LPVOID)0xC7DECC, &cpy, sizeof(cpy), NULL);
  989.             ReadProcessMemory(handle, (LPVOID)0xC7DED0, &cpz, sizeof(cpz), NULL);
  990.             ReadProcessMemory(handle, (LPCVOID)0xB6F5F0, &cped, sizeof(cped), NULL);
  991.             ReadProcessMemory(handle, (LPCVOID)(cped + 0x14), &matrix, sizeof(matrix), NULL);
  992.             ReadProcessMemory(handle, (LPVOID)0xC7DEEA, &cpon, sizeof(cpon), NULL);
  993.             if (cpon != 0) {
  994.                 WriteProcessMemory(handle, (LPVOID)(matrix + 0x30), &cpx, sizeof(cpx), NULL);
  995.                 WriteProcessMemory(handle, (LPVOID)(matrix + 0x34), &cpy, sizeof(cpy), NULL);
  996.                 WriteProcessMemory(handle, (LPVOID)(matrix + 0x38), &cpz, sizeof(cpz), NULL);
  997.             }
  998.  
  999.         }
  1000.     }
  1001.  
  1002.     if (teleportmap)
  1003.     {
  1004.         if (GetAsyncKeyState(VK_F10))
  1005.         {
  1006.             DWORD mapx, mapy, cpz, cped, cpon, matrix;
  1007.             mapx = *(DWORD*)0xBA67B8;
  1008.             mapy = *(DWORD*)0xBA67BC;
  1009.             cped = *(DWORD*)0xB6F5F0;
  1010.             matrix = *(DWORD*)(cped + 0x14);
  1011.  
  1012.             *(DWORD*)(matrix + 0x30) = mapx;
  1013.             *(DWORD*)(matrix + 0x34) = mapy;
  1014.         }
  1015.     }
  1016.  
  1017.     if (namech)
  1018.     {
  1019.         if (strlen(namechanger))
  1020.         {
  1021.  
  1022.             {
  1023.                 setLocalPlayerName(namechanger);
  1024.             }
  1025.         }
  1026.  
  1027.     }
  1028.  
  1029.     if (cheat_enable_spammer)
  1030.     {
  1031.         if (strlen(cheat_spammer_text))
  1032.         {
  1033.             if (cheat_spammer_delay)
  1034.             {
  1035.                 static int sent = 0;
  1036.  
  1037.                 if ((GetTickCount() - sent) >= cheat_spammer_delay)
  1038.                 {
  1039.                     say(cheat_spammer_text);
  1040.                     sent = GetTickCount();
  1041.                 }
  1042.             }
  1043.             else
  1044.             {
  1045.                 say(cheat_spammer_text);
  1046.             }
  1047.         }
  1048.     }
  1049.  
  1050.  
  1051.     if (c_infRun)
  1052.     {
  1053.  
  1054.         *infRun = 1;
  1055.         c_infRun = true;
  1056.  
  1057.     }
  1058.     else {
  1059.         *infRun = 0;
  1060.         c_infRun = false;
  1061.     }
  1062.  
  1063.     if (ioxygen)
  1064.     {
  1065.         DWORD infiniteoxygenAddr = 0x96916E;
  1066.         DWORD infiniteoxygen = 1;
  1067.  
  1068.         WriteProcessMemory(handle, (LPVOID)infiniteoxygenAddr, &infiniteoxygen, sizeof(infiniteoxygen), 0);
  1069.     }
  1070.  
  1071.     if (rotationvar)
  1072.     {
  1073.         DWORD cped = 0;
  1074.         ReadProcessMemory(handle, (LPCVOID)0xB6F5F0, &cped, sizeof(DWORD), 0);
  1075.         DWORD moveAddr = cped + 0x560;
  1076.         DWORD move = 0; ReadProcessMemory(handle, (LPCVOID)moveAddr, &move, sizeof(move), 0);
  1077.         if (move == 1103626240) {} if (move >= 1089470463) {
  1078.             DWORD ceva = 1103626240;
  1079.             WriteProcessMemory(handle, (LPVOID)moveAddr, &ceva, sizeof(ceva), 0);
  1080.         }
  1081.     }
  1082.  
  1083.     if (Trigger)
  1084.     {
  1085.  
  1086.         int rem[5];
  1087.         rem[0] = *(int *)0xB6F3B8;
  1088.         rem[1] = rem[0];
  1089.         rem[1] += 0x79C;
  1090.         if (*(int *)rem[1] > 0)
  1091.         {
  1092.             INPUT    Input = { 0 };
  1093.             Input.type = INPUT_MOUSE;
  1094.             Input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
  1095.             SendInput(1, &Input, sizeof(INPUT));
  1096.             Sleep(100);
  1097.             ZeroMemory(&Input, sizeof(INPUT));
  1098.             Input.type = INPUT_MOUSE;
  1099.             Input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
  1100.             SendInput(1, &Input, sizeof(INPUT));
  1101.         }
  1102.     }
  1103.  
  1104.     if (wall)
  1105.     {
  1106.         pInfo = (DWORD*)(g_dwSAMP_Addr + SAMP_INFO);
  1107.         while (*pInfo == 0) Sleep(1000);
  1108.         while (*(DWORD*)(*pInfo + SAMP_SETTINGS) == 0) Sleep(1000);
  1109.         ThroughWalls = (BYTE*)(*(DWORD*)(*pInfo + SAMP_SETTINGS) + 0x2F);
  1110.         fDistance = (float*)((DWORD*)(*(DWORD*)(*pInfo + SAMP_SETTINGS) + 0x27));
  1111.  
  1112.         DWORD OldProt;
  1113.         VirtualProtect((LPVOID)ThroughWalls, 0x100, PAGE_EXECUTE_READWRITE, &OldProt);
  1114.         VirtualProtect((LPVOID)fDistance, 0x100, PAGE_EXECUTE_READWRITE, &OldProt);
  1115.  
  1116.         if (*ThroughWalls != 512)
  1117.         {
  1118.  
  1119.             *fDistance = (float)whsize * 15;
  1120.             *ThroughWalls = 512;
  1121.         }
  1122.  
  1123.         if (GetAsyncKeyState(VK_F8))
  1124.         {
  1125.             *fDistance = 70;
  1126.             Sleep(100);
  1127.             *ThroughWalls = 513;
  1128.         }
  1129.     }
  1130.     else
  1131.     {
  1132.         pInfo = (DWORD*)(g_dwSAMP_Addr + SAMP_INFO);
  1133.         while (*pInfo == 0) Sleep(1000);
  1134.         while (*(DWORD*)(*pInfo + SAMP_SETTINGS) == 0) Sleep(1000);
  1135.         ThroughWalls = (BYTE*)(*(DWORD*)(*pInfo + SAMP_SETTINGS) + 0x2F);
  1136.         fDistance = (float*)((DWORD*)(*(DWORD*)(*pInfo + SAMP_SETTINGS) + 0x27));
  1137.  
  1138.         DWORD OldProt;
  1139.         VirtualProtect((LPVOID)ThroughWalls, 0x100, PAGE_EXECUTE_READWRITE, &OldProt);
  1140.         VirtualProtect((LPVOID)fDistance, 0x100, PAGE_EXECUTE_READWRITE, &OldProt);
  1141.  
  1142.         if (*ThroughWalls != 513)
  1143.         {
  1144.  
  1145.             *fDistance = 70;
  1146.             *ThroughWalls = 513;
  1147.         }
  1148.     }
  1149.  
  1150.     if (c_norecoil)
  1151.     {
  1152.         DWORD norecoilAddr = 0xB7CDC8;
  1153.         DWORD norecoil = 1;
  1154.  
  1155.         ReadProcessMemory(handle, (LPCVOID)norecoilAddr, &norecoil, sizeof(norecoil), 0);
  1156.  
  1157.         norecoil = 1;
  1158.         DWORD valuetherm = 1.074754357;
  1159.         WriteProcessMemory(handle, (LPVOID)norecoilAddr, &valuetherm, sizeof(valuetherm), 0);
  1160.         Sleep(10);
  1161.  
  1162.     }
  1163.  
  1164.     if (bAntiStun)
  1165.     {
  1166.         if (!pSAMP->getPlayers())
  1167.             return;
  1168.         if (!bAntiStunned)
  1169.         {
  1170.             // but it doesn't work only for sniper
  1171.             DWORD dwStunAddr = *(DWORD*)0x00B6F5F0;
  1172.             *(BYTE*)(dwStunAddr + 0x478) = 4;
  1173.         }
  1174.  
  1175.         // for sniper stun
  1176.         float fRate = 100.f;
  1177.         bAntiStunned = true;
  1178.     }
  1179.     else
  1180.     {
  1181.         if (bAntiStunned)
  1182.         {
  1183.             DWORD dwStunAddr = *(DWORD*)0x00B6F5F0;
  1184.             *(BYTE*)(dwStunAddr + 0x478) = 0;
  1185.  
  1186.             float fRate = 1.f;
  1187.             bAntiStunned = false;
  1188.         }
  1189.     }
  1190.     //JUMP BIKE
  1191.     if (c_bjump)
  1192.     {
  1193.         *bjump = 1;
  1194.         c_bjump = true;
  1195.     }
  1196.     else
  1197.     {
  1198.         *bjump = 0;
  1199.         c_bjump = false;
  1200.     }
  1201.     //JUMP BIKE
  1202.     //RESPECT KENDAMA
  1203.     if (gamespeedvar1)
  1204.     {
  1205.         *(float*)(0xB7CB64) = setgamespeed;
  1206.     }
  1207.     else
  1208.     {
  1209.         *(float*)(0xB7CB64);
  1210.     }
  1211.     //RESPECT KENDAMA
  1212.     // FPS UNLOCKER
  1213.     if (fpsunlockvar)
  1214.     {
  1215.         DWORD fps = 0;
  1216.         ReadProcessMemory(handle, (LPCVOID)((DWORD)samp + 0x9D9D0), &fps, sizeof(fps), 0);
  1217.  
  1218.         if (fps != 1347550997)
  1219.         {
  1220.             DWORD pFps = 1347550997;
  1221.             WriteProcessMemory(handle, (LPVOID)((DWORD)samp + 0x9D9D0), &pFps, sizeof(pFps), 0);
  1222.  
  1223.         }
  1224.     }
  1225.     //FPS UNLOCKER STOP
  1226.     if (!fpsunlockvar)
  1227.     {
  1228.         DWORD fps = 0;
  1229.         ReadProcessMemory(handle, (LPCVOID)((DWORD)samp + 0x9D9D0), &fps, sizeof(fps), 0);
  1230.  
  1231.         if (fps == 1347550997)
  1232.         {
  1233.             DWORD pFps = 1347550997;
  1234.             WriteProcessMemory(handle, (LPVOID)((DWORD)samp + 0x9D9D0), &pFps, sizeof(pFps), 0);
  1235.  
  1236.         }
  1237.     }
  1238.  
  1239.     // inf ammo
  1240.     if (infammovar)
  1241.     {
  1242.         DWORD infiniteammoAddr = 0x969178;
  1243.         DWORD infiniteammo3 = 1;
  1244.         WriteProcessMemory(handle, (LPVOID)infiniteammoAddr, &infiniteammo3, sizeof(infiniteammo3), 0);
  1245.     }
  1246.  
  1247.     if (!infammovar)
  1248.     {
  1249.         DWORD infiniteammoAddr = 0x969178;
  1250.         DWORD infiniteammo3 = 0;
  1251.         WriteProcessMemory(handle, (LPVOID)infiniteammoAddr, &infiniteammo3, sizeof(infiniteammo3), 0);
  1252.  
  1253.         infiniteammo3 = 0;
  1254.         Sleep(10);
  1255.  
  1256.     }
  1257.  
  1258.     //rotatie
  1259.     /*if (rotationvar)
  1260.     {
  1261.         DWORD cped = 0;
  1262.         ReadProcessMemory(handle, (LPCVOID)0xB6F5F0, &cped, sizeof(DWORD), 0);
  1263.         DWORD moveAddr = cped + 0x560;
  1264.         DWORD move = 0; ReadProcessMemory(handle, (LPCVOID)moveAddr, &move, sizeof(move), 0);
  1265.         if (move == 1103626240) {} if (move >= 1089470463) {
  1266.             DWORD ceva = 1103626240;
  1267.             WriteProcessMemory(handle, (LPVOID)moveAddr, &ceva, sizeof(ceva), 0);
  1268.         }
  1269.     }*/
  1270.     //GodMode
  1271.     if (c_GodMode)
  1272.     {
  1273.         *GodMode = 1;
  1274.         c_GodMode = true;
  1275.     }
  1276.     else
  1277.     {
  1278.         *GodMode = 0;
  1279.         c_GodMode = false;
  1280.     }
  1281.     //GodMode
  1282.     // Thermalvision
  1283.     //start thermal
  1284.     if (thermalvisionvar)
  1285.     {
  1286.  
  1287.         DWORD thermalvisionAddr = 0xC402B8;
  1288.         DWORD thermalvision = 1;
  1289.  
  1290.         ReadProcessMemory(handle, (LPCVOID)thermalvisionAddr, &thermalvision, sizeof(thermalvision), 0);
  1291.  
  1292.         thermalvision = 1;
  1293.         DWORD valuetherm = 256;
  1294.         WriteProcessMemory(handle, (LPVOID)thermalvisionAddr, &valuetherm, sizeof(valuetherm), 0);
  1295.         Sleep(10);
  1296.  
  1297.     }
  1298.     //stop thermal
  1299.     if (!thermalvisionvar)
  1300.     {
  1301.         DWORD thermalvisionAddr = 0xC402B8;
  1302.         DWORD thermalvision = 0;
  1303.  
  1304.         ReadProcessMemory(handle, (LPCVOID)thermalvisionAddr, &thermalvision, sizeof(thermalvision), 0);
  1305.  
  1306.         thermalvision = 0;
  1307.         DWORD valuetherm = 0;
  1308.         WriteProcessMemory(handle, (LPVOID)thermalvisionAddr, &thermalvision, sizeof(valuetherm), 0);
  1309.  
  1310.     }
  1311.     else
  1312.     {
  1313.         pInfo = (DWORD*)(g_dwSAMP_Addr + SAMP_INFO);
  1314.         while (*pInfo == 0) Sleep(1000);
  1315.         while (*(DWORD*)(*pInfo + SAMP_SETTINGS) == 0) Sleep(1000);
  1316.         ThroughWalls = (BYTE*)(*(DWORD*)(*pInfo + SAMP_SETTINGS) + 0x2F);
  1317.         fDistance = (float*)((DWORD*)(*(DWORD*)(*pInfo + SAMP_SETTINGS) + 0x27));
  1318.  
  1319.         DWORD OldProt;
  1320.         VirtualProtect((LPVOID)ThroughWalls, 0x100, PAGE_EXECUTE_READWRITE, &OldProt);
  1321.         VirtualProtect((LPVOID)fDistance, 0x100, PAGE_EXECUTE_READWRITE, &OldProt);
  1322.  
  1323.         if (*ThroughWalls != 513)
  1324.         {
  1325.  
  1326.             *fDistance = 70;
  1327.             *ThroughWalls = 513;
  1328.         }
  1329.     }
  1330.     // Mousefix
  1331.     if (mousefixvar) // CREDITE GARRET PENTRU SURSA MOUSEFIX
  1332.     {
  1333.         float xaxis;
  1334.         float yaxis;
  1335.         ReadProcessMemory(handle, (PBYTE*)0xB6EC1C, &xaxis, 4, 0);
  1336.         ReadProcessMemory(handle, (PBYTE*)0xB6EC18, &yaxis, 4, 0);
  1337.         if (xaxis != yaxis)
  1338.         {
  1339.             WriteProcessMemory(handle, (LPVOID)0xB6EC18, &xaxis, 4, 0);
  1340.         }
  1341.     }
  1342.     //Mega jump
  1343.     // start megajump
  1344.     if (megajumpvar)
  1345.     {
  1346.         DWORD megajumpAddr = 0x96916C;
  1347.         DWORD megajump = 1;
  1348.         ReadProcessMemory(handle, (LPCVOID)megajumpAddr, &megajump, sizeof(megajump), 0);
  1349.  
  1350.         megajump = 1;
  1351.         WriteProcessMemory(handle, (LPVOID)megajumpAddr, &megajump, sizeof(megajump), 0);
  1352.         Sleep(10);
  1353.  
  1354.     }
  1355.     //stop megajump
  1356.     if (!megajumpvar)
  1357.     {
  1358.         DWORD megajumpAddr = 0x96916C;
  1359.         DWORD megajump = 0;
  1360.         ReadProcessMemory(handle, (LPCVOID)megajumpAddr, &megajump, sizeof(megajump), 0);
  1361.  
  1362.         if (megajump == 1)
  1363.         {
  1364.             megajump = 0;
  1365.             WriteProcessMemory(handle, (LPVOID)megajumpAddr, &megajump, sizeof(megajump), 0);
  1366.             Sleep(10);
  1367.         }
  1368.     }
  1369.  
  1370.     //WaterCar
  1371.     // start watercar
  1372.     if (watercarvar)
  1373.     {
  1374.         DWORD watercarAddr = 0x6C2759;
  1375.         DWORD watercar = 1;
  1376.         ReadProcessMemory(handle, (LPVOID)watercarAddr, &watercar, sizeof(watercar), 0);
  1377.  
  1378.         watercar = 1;
  1379.         WriteProcessMemory(handle, (LPVOID)watercarAddr, &watercar, sizeof(watercar), 0);
  1380.         Sleep(10);
  1381.  
  1382.     }
  1383.     // stop watercar
  1384.     if (!watercarvar)
  1385.     {
  1386.         DWORD watercarAddr = 0x6C2759;
  1387.         DWORD watercar = 0;
  1388.         ReadProcessMemory(handle, (LPVOID)watercarAddr, &watercar, sizeof(watercar), 0);
  1389.  
  1390.         if (watercar = 1)
  1391.         {
  1392.             watercar = 0;
  1393.             WriteProcessMemory(handle, (LPVOID)watercarAddr, &watercar, sizeof(watercar), 0);
  1394.             Sleep(10);
  1395.         }
  1396.  
  1397.     }
  1398.     // inf run
  1399.     if (c_infRun)
  1400.     {
  1401.  
  1402.         *infRun = 1;
  1403.         c_infRun = true;
  1404.  
  1405.     }
  1406.     else {
  1407.         *infRun = 0;
  1408.         c_infRun = false;
  1409.     }
  1410.     // Infinite oxygen
  1411.     // start oxygen
  1412.     if (ioxygen)
  1413.     {
  1414.         DWORD infiniteoxygenAddr = 0x96916E;
  1415.         DWORD infiniteoxygen = 1;
  1416.  
  1417.         WriteProcessMemory(handle, (LPVOID)infiniteoxygenAddr, &infiniteoxygen, sizeof(infiniteoxygen), 0);
  1418.     }
  1419.  
  1420.     // stop oxygen
  1421.     if (!ioxygen)
  1422.     {
  1423.         DWORD infiniteoxygenAddr = 0x96916E;
  1424.         DWORD infiniteoxygen = 0;
  1425.  
  1426.         WriteProcessMemory(handle, (LPVOID)infiniteoxygenAddr, &infiniteoxygen, sizeof(infiniteoxygen), 0);
  1427.     }
  1428.     //tankmode
  1429.     if (tankmodecar)
  1430.     {
  1431.         DWORD tankmodeAddr = 0x969164;
  1432.         DWORD tankmode = 1;
  1433.         ReadProcessMemory(handle, (LPVOID)tankmodeAddr, &tankmode, sizeof(tankmode), 0);
  1434.  
  1435.         tankmode = 1;
  1436.         WriteProcessMemory(handle, (LPVOID)tankmodeAddr, &tankmode, sizeof(tankmode), 0);
  1437.         Sleep(10);
  1438.  
  1439.     }
  1440.     // stop tank
  1441.     if (!tankmodecar)
  1442.     {
  1443.         DWORD tankmodeAddr = 0x969164;
  1444.         DWORD tankmode = 0;
  1445.         ReadProcessMemory(handle, (LPVOID)tankmodeAddr, &tankmode, sizeof(tankmode), 0);
  1446.  
  1447.         if (tankmode = 1)
  1448.         {
  1449.             tankmode = 0;
  1450.             WriteProcessMemory(handle, (LPVOID)tankmodeAddr, &tankmode, sizeof(tankmode), 0);
  1451.             Sleep(10);
  1452.         }
  1453.  
  1454.     }
  1455.     //nitro
  1456.     if (nitrocar)
  1457.     {
  1458.         DWORD nitromodeAddr = 0x969165;
  1459.         DWORD nitromode = 1;
  1460.         ReadProcessMemory(handle, (LPVOID)nitromodeAddr, &nitromode, sizeof(nitromode), 0);
  1461.  
  1462.         nitromode = 1;
  1463.         WriteProcessMemory(handle, (LPVOID)nitromodeAddr, &nitromode, sizeof(nitromode), 0);
  1464.         Sleep(10);
  1465.  
  1466.     }
  1467.     // stop nitro
  1468.     if (!nitrocar)
  1469.     {
  1470.         DWORD nitromodeAddr = 0x969165;
  1471.         DWORD nitromode = 0;
  1472.         ReadProcessMemory(handle, (LPVOID)nitromodeAddr, &nitromode, sizeof(nitromode), 0);
  1473.  
  1474.         if (nitromode = 1)
  1475.         {
  1476.             nitromode = 0;
  1477.             WriteProcessMemory(handle, (LPVOID)nitromodeAddr, &nitromode, sizeof(nitromode), 0);
  1478.             Sleep(10);
  1479.         }
  1480.  
  1481.     }
  1482.     if (normalaim)
  1483.     {
  1484.         float fcxpos;
  1485.         float fcypos;
  1486.         float camxpos;
  1487.         float camypos;
  1488.         float fpvectorx;
  1489.         float fpvectory;
  1490.         float fxpos1;
  1491.         float fypos1;
  1492.         float fzpos1;
  1493.         float fxpos2;
  1494.         float fypos2;
  1495.         float fzpos2;
  1496.         float fxpos2a;
  1497.         float fypos2a;
  1498.         float fzpos2a;
  1499.         float fphp;
  1500.         float aa;
  1501.         float ab;
  1502.         float ac;
  1503.         float beta;
  1504.         float alpha;
  1505.         int t;
  1506.         int wID;
  1507.         int keyt;
  1508.         t = 0;
  1509.  
  1510.         DWORD php;
  1511.         DWORD xpos1;
  1512.         DWORD ypos1;
  1513.         DWORD zpos1;
  1514.         DWORD xpos2;
  1515.         DWORD ypos2;
  1516.         DWORD zpos2;
  1517.         DWORD pmtrx1;
  1518.         DWORD pmtrx2;
  1519.         DWORD pvectorx;
  1520.         DWORD pvectory;
  1521.         DWORD gpoint;
  1522.         DWORD ptarget;
  1523.         DWORD pped;
  1524.         DWORD pId;
  1525.         ReadProcessMemory(handle, (LPCVOID)0xBAA410, &wID, sizeof(int), 0);
  1526.         ReadProcessMemory(handle, (LPCVOID)0xB6F5F0, &gpoint, 4, 0);
  1527.  
  1528.  
  1529.  
  1530.         if (gpoint > 0) {
  1531.             pmtrx1 = gpoint + 0x14; // location pointer of player XYZ
  1532.             ReadProcessMemory(handle, (LPCVOID)pmtrx1, &pmtrx1, 4, 0);
  1533.  
  1534.             xpos1 = pmtrx1 + 0x30; // x position of player
  1535.             ypos1 = pmtrx1 + 0x34; // y position of player
  1536.             zpos1 = pmtrx1 + 0x38; // z position of player
  1537.  
  1538.             ReadProcessMemory(handle, (LPCVOID)xpos1, &fxpos1, 4, 0);
  1539.             ReadProcessMemory(handle, (LPCVOID)ypos1, &fypos1, 4, 0);
  1540.             ReadProcessMemory(handle, (LPCVOID)zpos1, &fzpos1, 4, 0);
  1541.  
  1542.             ReadProcessMemory(handle, (LPCVOID)0xB6F9CC, &fcxpos, 4, 0); // not really sure
  1543.             ReadProcessMemory(handle, (LPCVOID)0xB6F9D0, &fcypos, 4, 0); // not really sure
  1544.  
  1545.             ReadProcessMemory(handle, (LPCVOID)0xB6F3B8, &ptarget, 4, 0); // pointer to target
  1546.  
  1547.             pped = ptarget + 0x79C; // our current target
  1548.             ReadProcessMemory(handle, (LPCVOID)pped, &pped, 4, 0);
  1549.  
  1550.             if (pped > 0)
  1551.             {
  1552.                 pvectorx = pped + 0x44; // border (x) (hitbox)
  1553.                 pvectory = pped + 0x48; // border (y) (hitbox)
  1554.  
  1555.                 ReadProcessMemory(handle, (LPCVOID)pvectorx, &fpvectorx, 4, 0);
  1556.                 ReadProcessMemory(handle, (LPCVOID)pvectory, &fpvectory, 4, 0);
  1557.  
  1558.                 pmtrx2 = pped + 0x14; // pointer to XYZ of target
  1559.                 ReadProcessMemory(handle, (LPCVOID)pmtrx2, &pmtrx2, 4, 0);
  1560.  
  1561.                 xpos2 = pmtrx2 + 0x30; // x position (of target)
  1562.                 ypos2 = pmtrx2 + 0x34; // y position (of target)
  1563.                 zpos2 = pmtrx2 + 0x38; //  position (of target)
  1564.  
  1565.                 ReadProcessMemory(handle, (LPCVOID)xpos2, &fxpos2, 4, 0);
  1566.                 ReadProcessMemory(handle, (LPCVOID)ypos2, &fypos2, 4, 0);
  1567.                 ReadProcessMemory(handle, (LPCVOID)zpos2, &fzpos2, 4, 0);
  1568.  
  1569.                 php = pped + 0x540; // ped health
  1570.                 ReadProcessMemory(handle, (LPCVOID)php, &fphp, 4, 0);
  1571.  
  1572.                 float theta, dist;
  1573.                 if (fphp > 0) // if ped health > 0
  1574.                 {
  1575.                     //dist = sqrt((float)(xpos2-xpos1)*(xpos2-xpos1) + (ypos2-ypos1)*(ypos2-ypos1) + (zpos2-zpos1)*(zpos2-zpos1));
  1576.  
  1577.                     dist = sqrt((fxpos2 - fxpos1)*(fxpos2 - fxpos1) + (fypos2 - fypos1)*(fypos2 - fypos1) + (fzpos2 - fzpos1)*(fzpos2 - fzpos1));
  1578.                     theta = asin((fzpos2 - fzpos1) / dist);
  1579.                     theta -= (90 / (3.14 * 180));
  1580.  
  1581.                     fxpos2a = fxpos2;
  1582.                     fypos2a = fypos2;
  1583.  
  1584.                     aa = fabs(fcxpos - fxpos2);
  1585.                     ab = fabs(fcypos - fypos2);
  1586.                     ac = sqrt(aa*aa + ab * ab);
  1587.  
  1588.                     alpha = asin(aa / ac);
  1589.                     beta = acos(aa / ac);
  1590.  
  1591.                     if ((fxpos1 > fxpos2) && (fypos1 < fypos2))
  1592.                     {
  1593.                         beta = -beta;
  1594.                     }
  1595.                     if ((fxpos1 > fxpos2) && (fypos1 > fypos2))
  1596.                     {
  1597.                         beta = beta;
  1598.                     }
  1599.                     if ((fxpos1 < fxpos2) && (fypos1 > fypos2))
  1600.                     {
  1601.                         beta = (alpha + (3.14 / 2));
  1602.                     }
  1603.                     if ((fxpos1 < fxpos2) && (fypos1 < fypos2))
  1604.                     {
  1605.                         beta = (-alpha - (3.14 / 2));
  1606.                     }
  1607.  
  1608.                     if (wID == 24 && deaglechecked) {
  1609.                         camxpos = beta + 0.0410;
  1610.                         camypos = theta + 0.0389 + dist / 3000;
  1611.                         WriteProcessMemory(handle, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                        
  1612.                     }
  1613.                     if (wID == 31 && m4a1checked) {
  1614.                         camxpos = beta + 0.0300 + (dist / 14000);
  1615.                         camypos = theta + 0.0389 + dist / 3000;
  1616.                         WriteProcessMemory(handle, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                        
  1617.                     }
  1618.                     if (wID == 27 && combatchecked) {
  1619.                         camxpos = beta + 0.0300 + (dist / 14000);
  1620.                         camypos = theta + 0.0389 + dist / 3000;
  1621.                         WriteProcessMemory(handle, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                        
  1622.                     }
  1623.                     if (wID == 32 && tecchecked) {
  1624.                         camxpos = beta + 0.0300 + (dist / 14000);
  1625.                         camypos = theta + 0.0389 + dist / 3000;
  1626.                         WriteProcessMemory(handle, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                        
  1627.                     }
  1628.                     if (wID == 33 && riflechecked) {
  1629.                         camxpos = beta + 0.0300 + (dist / 14000);
  1630.                         camypos = theta + 0.0389 + dist / 3000;
  1631.                         WriteProcessMemory(handle, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                        
  1632.                     }
  1633.                     if (wID == 25 && shotgunchecked) {
  1634.                         camxpos = beta + 0.0300 + (dist / 14000);
  1635.                         camypos = theta + 0.0389 + dist / 3000;
  1636.                         WriteProcessMemory(handle, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                        
  1637.                     }
  1638.                     if (wID == 23 && silencedchecked) {
  1639.                         camxpos = beta + 0.0300 + (dist / 14000);
  1640.                         camypos = theta + 0.0389 + dist / 3000;
  1641.                         WriteProcessMemory(handle, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                        
  1642.                     }
  1643.                     if (wID == 38 && minigunchecked) {
  1644.                         camxpos = beta + 0.0300 + (dist / 14000);
  1645.                         camypos = theta + 0.0389 + dist / 3000;
  1646.                         WriteProcessMemory(handle, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                        
  1647.                     }
  1648.                     if (wID == 34 && sniperchecked) {
  1649.                         camxpos = beta + 0.0300 + (dist / 14000);
  1650.                         camypos = theta + 0.0389 + dist / 3000;
  1651.                         WriteProcessMemory(handle, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                        
  1652.                     }
  1653.                     if (wID == 30 && akchecked) {
  1654.                         camxpos = beta + 0.0300 + (dist / 14000);
  1655.                         camypos = theta + 0.0389 + dist / 3000;
  1656.                         WriteProcessMemory(handle, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                        
  1657.                     }
  1658.                     if (wID == 29 && mp5checked) {
  1659.                         camxpos = beta + 0.0300 + (dist / 14000);
  1660.                         camypos = theta + 0.0389 + dist / 3000;
  1661.                         WriteProcessMemory(handle, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                        
  1662.                     }
  1663.                 }
  1664.             }
  1665.         }
  1666.     }
  1667. }
  1668.  
  1669. void Pleata()
  1670. {
  1671.     ImGuiStyle& style = ImGui::GetStyle();
  1672.     style.Colors[ImGuiCol_Text] = ImVec4(0.90f, 0.90f, 0.90f, 1.00f);
  1673.     style.Colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f);
  1674.     style.Colors[ImGuiCol_WindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.70f);
  1675.     style.Colors[ImGuiCol_ChildWindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
  1676.     style.Colors[ImGuiCol_PopupBg] = ImVec4(0.05f, 0.05f, 0.10f, 0.90f);
  1677.     style.Colors[ImGuiCol_Border] = ImVec4(0.70f, 0.70f, 0.70f, 0.65f);
  1678.     style.Colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
  1679.     style.Colors[ImGuiCol_FrameBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.30f);
  1680.     style.Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.90f, 0.80f, 0.80f, 0.40f);
  1681.     style.Colors[ImGuiCol_FrameBgActive] = ImVec4(0.90f, 0.65f, 0.65f, 0.45f);
  1682.     style.Colors[ImGuiCol_TitleBg] = ImVec4(0.69f, 0.08f, 0.00f, 1.00f);
  1683.     style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(1.00f, 0.00f, 0.00f, 1.00f);
  1684.     style.Colors[ImGuiCol_TitleBgActive] = ImVec4(0.69f, 0.08f, 0.00f, 1.00f);
  1685.     style.Colors[ImGuiCol_MenuBarBg] = ImVec4(0.42f, 0.00f, 0.00f, 0.78f);
  1686.     style.Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.20f, 0.25f, 0.30f, 0.60f);
  1687.     style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.51f, 0.00f, 0.00f, 0.78f);
  1688.     style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.84f, 0.01f, 0.01f, 0.59f);
  1689.     style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(1.00f, 0.00f, 0.00f, 1.00f);
  1690.     style.Colors[ImGuiCol_ComboBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.99f);
  1691.     style.Colors[ImGuiCol_CheckMark] = ImVec4(0.90f, 0.90f, 0.90f, 0.50f);
  1692.     style.Colors[ImGuiCol_SliderGrab] = ImVec4(1.00f, 1.00f, 1.00f, 0.30f);
  1693.     style.Colors[ImGuiCol_SliderGrabActive] = ImVec4(0.80f, 0.50f, 0.50f, 1.00f);
  1694.     style.Colors[ImGuiCol_Button] = ImVec4(0.51f, 0.00f, 0.00f, 0.78f);
  1695.     style.Colors[ImGuiCol_ButtonHovered] = ImVec4(0.67f, 0.40f, 0.40f, 1.00f);
  1696.     style.Colors[ImGuiCol_ButtonActive] = ImVec4(0.80f, 0.50f, 0.50f, 1.00f);
  1697.     style.Colors[ImGuiCol_Header] = ImVec4(0.84f, 0.01f, 0.01f, 0.59f);
  1698.     style.Colors[ImGuiCol_HeaderHovered] = ImVec4(0.59f, 0.00f, 0.00f, 0.59f);
  1699.     style.Colors[ImGuiCol_HeaderActive] = ImVec4(0.84f, 0.01f, 0.01f, 0.59f);
  1700.     style.Colors[ImGuiCol_Column] = ImVec4(0.50f, 0.50f, 0.50f, 1.00f);
  1701.     style.Colors[ImGuiCol_ColumnHovered] = ImVec4(0.70f, 0.60f, 0.60f, 1.00f);
  1702.     style.Colors[ImGuiCol_ColumnActive] = ImVec4(0.90f, 0.70f, 0.70f, 1.00f);
  1703.     style.Colors[ImGuiCol_ResizeGrip] = ImVec4(1.00f, 1.00f, 1.00f, 0.30f);
  1704.     style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(1.00f, 1.00f, 1.00f, 0.60f);
  1705.     style.Colors[ImGuiCol_ResizeGripActive] = ImVec4(1.00f, 1.00f, 1.00f, 0.90f);
  1706.     style.Colors[ImGuiCol_CloseButton] = ImVec4(0.50f, 0.50f, 0.90f, 0.50f);
  1707.     style.Colors[ImGuiCol_CloseButtonHovered] = ImVec4(0.70f, 0.70f, 0.90f, 0.60f);
  1708.     style.Colors[ImGuiCol_CloseButtonActive] = ImVec4(0.70f, 0.70f, 0.70f, 1.00f);
  1709.     style.Colors[ImGuiCol_PlotLines] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
  1710.     style.Colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
  1711.     style.Colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
  1712.     style.Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f);
  1713.     style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.00f, 0.00f, 1.00f, 0.35f);
  1714.     style.Colors[ImGuiCol_ModalWindowDarkening] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f);
  1715.     //style.WindowTitleAlign = ImVec2(0.5f, 0.5f);
  1716.     style.WindowTitleAlign = ImGuiAlign_Center;
  1717.  
  1718. }
  1719.  
  1720. //stuff
  1721.  
  1722. void toggleSAMPCursor(int iToggle)
  1723. {
  1724.     void        *obj = *(void **)((DWORD)samp + 0x21A10C);
  1725.     ((void(__thiscall *) (void *, int, bool)) ((DWORD)samp + 0x9BD30))(obj, iToggle ? 3 : 0, !iToggle);
  1726.     if (!iToggle)
  1727.         ((void(__thiscall *) (void *)) ((DWORD)samp + 0x9BC10))(obj);
  1728. }
  1729.  
  1730. void toggleChat(int toggle)
  1731. {
  1732.     int togchattrue = 0xC3;
  1733.     int togchatfalse = 2347862870;
  1734.     everything();
  1735.  
  1736.     if (toggle == 1)
  1737.     {
  1738.         WriteProcessMemory(handle, (LPVOID)((DWORD)samp + 0x64230), &togchattrue, sizeof(togchattrue), 0);
  1739.     }
  1740.     else
  1741.     {
  1742.         WriteProcessMemory(handle, (LPVOID)((DWORD)samp + 0x64230), &togchatfalse, sizeof(togchatfalse), 0);
  1743.     }
  1744. }
  1745.  
  1746. void Shutdown()
  1747. {
  1748.     void** vTableDevice = *(void***)(*(DWORD*)DEVICE_PTR);
  1749.     VTableHookManager* vmtHooks = new VTableHookManager(vTableDevice, D3D_VFUNCTIONS);
  1750.     vmtHooks->Unhook(ENDSCENE_INDEX);
  1751.     menuOpen = false;
  1752.     toggleSAMPCursor(0);
  1753.     toggleChat(0);
  1754.     close = 1;
  1755.     wall = false;
  1756.     c_infRun = false;
  1757.     ioxygen = false;
  1758.     fake_kick = false;
  1759.     watercarvar = false;
  1760.     megajumpvar = false;
  1761.     mousefixvar = false;
  1762.     thermalvisionvar = false;
  1763.     aimbotvar = false;
  1764.     rotationvar = false;
  1765.     infammovar = false;
  1766.     fpsunlockvar = false;
  1767.     c_GodMode = false;
  1768.     Trigger = false;
  1769.     tp = false;
  1770.     c_bjump = false;
  1771.     c_cnormal = false;
  1772.     wall = false;
  1773.     c_norecoil = false;
  1774.     atentat1 = false;
  1775.     normalaim = false;
  1776.     nitrocar = false;
  1777.     ghostmode = false;
  1778.     tankmodecar = false;
  1779.     weather = false;
  1780.     taim = false;
  1781.     bAntiStun = false;
  1782.     checkpoint = false;
  1783.     spawnme = false;
  1784.     RainbowHud = false;
  1785.     culoare_pusa = false;
  1786.     fake_ping = false;
  1787.     teleportmap = false;
  1788.     teleportcp = false;
  1789.     upside = false;
  1790.     RainbowRadar = false;
  1791.     tintarainbow = false;
  1792.     mp5checked = false;
  1793.     akchecked = false;
  1794.     sniperchecked = false;
  1795.     minigunchecked = false;
  1796.     silencedchecked = false;
  1797.     shotgunchecked = false;
  1798.     riflechecked = false;
  1799.     tecchecked = false;
  1800.     combatchecked = false;
  1801.     m4a1checked = false;
  1802.     deaglechecked = false;
  1803.     aimbotmenu = false;
  1804.     fakepingmenu = false;
  1805.     timemenu = false;
  1806.     wallhackmenu = false;
  1807.     rainbowmenu = false;
  1808.     rainbowmenu2 = false;
  1809.     weathermenu = false;
  1810.     gamespeedmenu = false;
  1811.     gamespeedvar1 = false;
  1812.     rainbowcarlight = false;
  1813.     slapper = false;
  1814. }
  1815.  
  1816. SAMPFramework *pSAMP;
  1817. CD3DHook *pD3DHook;
  1818.  
  1819.  
  1820. void RenderGUI()
  1821. {
  1822.     static float f = 0.0f;
  1823.     ImGuiWindowFlags window_flags = 0;
  1824.     window_flags |= ImGuiWindowFlags_NoResize;
  1825.     window_flags |= ImGuiWindowFlags_NoCollapse;
  1826.     window_flags |= ImGuiWindowFlags_MenuBar;
  1827.     ImGuiWindowFlags window_flags_about = 0;
  1828.     window_flags_about |= ImGuiWindowFlags_NoResize;
  1829.     window_flags_about |= ImGuiWindowFlags_NoCollapse;
  1830.     window_flags_about |= ImGuiWindowFlags_NoMove;
  1831.     ImGui::SetNextWindowSize(ImVec2(700.f, 425.f));
  1832.  
  1833.     if (!ImGui::Begin("RedEye v0.3.0", p_open = NULL, window_flags))
  1834.     {
  1835.         ImGui::End();
  1836.         return;
  1837.     }
  1838.     if (ImGui::BeginMenuBar())
  1839.     {
  1840.         ImGui::SetNextWindowSize(ImVec2(140.f, 60.f));
  1841.         if (ImGui::BeginMenu("More"))
  1842.         {
  1843.             if (ImGui::Button("About", ImVec2(125.f, 20.f)))
  1844.                 ImGui::OpenPopup("About");
  1845.             if (ImGui::BeginPopupModal("About", p_open = NULL, window_flags_about))
  1846.             {
  1847.                 ImGui::Text("Developer: Ryon.SiLENT");
  1848.                 ImGui::Separator();
  1849.                 ImGui::Text("Special Thanks:");
  1850.                 ImGui::Text("Nilmer");
  1851.                 ImGui::Text("Serban1337");
  1852.                 ImGui::Text("Side");
  1853.                 if (ImGui::Button("Close", ImVec2(200.f, 20.f)))
  1854.                 {
  1855.                     ImGui::CloseCurrentPopup();
  1856.                 }
  1857.                 ImGui::EndPopup();
  1858.             }
  1859.             if (ImGui::Button("Disable All", ImVec2(125.f, 20.f)))
  1860.             {
  1861.                 wall = false;
  1862.                 c_infRun = false;
  1863.                 ioxygen = false;
  1864.                 watercarvar = false;
  1865.                 megajumpvar = false;
  1866.                 mousefixvar = false;
  1867.                 ghostmode = false;
  1868.                 thermalvisionvar = false;
  1869.                 aimbotvar = false;
  1870.                 rotationvar = false;
  1871.                 infammovar = false;
  1872.                 fpsunlockvar = false;
  1873.                 c_GodMode = false;
  1874.                 fake_kick = false;
  1875.                 tp = false;
  1876.                 Trigger = false;
  1877.                 c_bjump = false;
  1878.                 wall = false;
  1879.                 c_norecoil = false;
  1880.                 atentat1 = false;
  1881.                 normalaim = false;
  1882.                 nitrocar = false;
  1883.                 tankmodecar = false;
  1884.                 weather = false;
  1885.                 taim = false;
  1886.                 bAntiStun = false;
  1887.                 checkpoint = false;
  1888.                 spawnme = false;
  1889.                 RainbowHud = false;
  1890.                 culoare_pusa = false;
  1891.                 fake_ping = false;
  1892.                 rainbowmenu = false;
  1893.                 teleportmap = false;
  1894.                 teleportcp = false;
  1895.                 RainbowRadar = false;
  1896.                 tintarainbow = false;
  1897.                 upside = false;
  1898.                 mp5checked = false;
  1899.                 akchecked = false;
  1900.                 sniperchecked = false;
  1901.                 minigunchecked = false;
  1902.                 silencedchecked = false;
  1903.                 shotgunchecked = false;
  1904.                 riflechecked = false;
  1905.                 tecchecked = false;
  1906.                 combatchecked = false;
  1907.                 m4a1checked = false;
  1908.                 deaglechecked = false;
  1909.                 aimbotmenu = false;
  1910.                 fakepingmenu = false;
  1911.                 timemenu = false;
  1912.                 wallhackmenu = false;
  1913.                 rainbowmenu2 = false;
  1914.                 weathermenu = false;
  1915.                 gamespeedvar1 = false;
  1916.                 gamespeedmenu = false;
  1917.                 slapper = false;
  1918.                 rainbowcarlight = false;
  1919.             }
  1920.             ImGui::EndMenu();
  1921.         }
  1922.         if (ImGui::BeginMenu("Settings"))
  1923.         {
  1924.             const char* items[] = { "Insert", "Home", "Delete","End" };
  1925.             ImGui::PushItemWidth(125.f);
  1926.             ImGui::Combo("##2000", &startmenu, items, 4);
  1927.             if (startmenu == 0)
  1928.             {
  1929.                 key = VK_INSERT;
  1930.             }
  1931.             if (startmenu == 1)
  1932.             {
  1933.                 key = VK_HOME;
  1934.             }
  1935.             if (startmenu == 2)
  1936.             {
  1937.                 key = VK_DELETE;
  1938.             }
  1939.             if (startmenu == 3)
  1940.             {
  1941.                 key = VK_END;
  1942.             }
  1943.             ImGui::EndMenu();
  1944.         }
  1945.         ImGui::EndMenuBar();
  1946.     }
  1947.     ImGui::BeginChild(1, ImVec2(100, 375));
  1948.     if (ImGui::Button("Weapon", ImVec2(100, 50)))
  1949.     {
  1950.         tabb = 1;
  1951.     }
  1952.     if (ImGui::Button("Visual", ImVec2(100, 50)))
  1953.     {
  1954.         tabb = 2;
  1955.     }
  1956.     if (ImGui::Button("Player", ImVec2(100, 50)))
  1957.     {
  1958.         tabb = 3;
  1959.     }
  1960.     if (ImGui::Button("Car", ImVec2(100, 50)))
  1961.     {
  1962.         tabb = 4;
  1963.     }
  1964.     if (ImGui::Button("Developer", ImVec2(100, 50)))
  1965.     {
  1966.         tabb = 5;
  1967.     }
  1968.     if (ImGui::Button("Rainbow", ImVec2(100, 50)))
  1969.     {
  1970.         tabb = 6;
  1971.     }
  1972.     if (ImGui::Button("Extra", ImVec2(100, 50)))
  1973.     {
  1974.         tabb = 7;
  1975.     }
  1976.     ImGui::EndChild();
  1977.     ImGui::SameLine();
  1978.     ImGui::BeginChild(2, ImVec2(600, 266));
  1979.     switch (tabb)
  1980.     {
  1981.     case 1:
  1982.     {
  1983.         ImGui::Checkbox("Aimbot", &normalaim);
  1984.         ImGui::SameLine(300.f);
  1985.         if (ImGui::Button("Settings## Aimbot"))
  1986.         {
  1987.             aimbotmenu = !aimbotmenu;
  1988.         }
  1989.         if (aimbotmenu)
  1990.         {
  1991.             ImGui::SetNextWindowSize(ImVec2(310.0f, 300.0f));
  1992.             if (ImGui::Begin("Aimbot Settings", p_open = NULL, window_flags))
  1993.             {
  1994.                 ImGui::Checkbox("Deagle", &deaglechecked);
  1995.                 ImGui::Checkbox("SD Pistol", &silencedchecked);
  1996.                 ImGui::Checkbox("M4", &m4a1checked);
  1997.                 ImGui::Checkbox("AK47", &akchecked);
  1998.                 ImGui::Checkbox("MP5", &mp5checked);
  1999.                 ImGui::Checkbox("Combat Shotgun", &combatchecked);
  2000.                 ImGui::Checkbox("ShotGun", &shotgunchecked);
  2001.                 ImGui::Checkbox("TEC", &tecchecked);
  2002.                 ImGui::Checkbox("Minigun", &minigunchecked);
  2003.                 if (ImGui::Button("Hide", ImVec2(75.f, 20.f)))
  2004.                 {
  2005.                     aimbotmenu = !aimbotmenu;
  2006.                 }
  2007.                 ImGui::End();
  2008.             }
  2009.         }
  2010.         ImGui::Checkbox("Trigger Bot", &Trigger);
  2011.         ImGui::Checkbox("No Recoil", &c_norecoil);
  2012.         ImGui::Checkbox("Infinite Ammo / No-Reload", &infammovar);
  2013.         ImGui::Checkbox("Mousefix", &mousefixvar);
  2014.         break;
  2015.     }
  2016.     case 2:
  2017.     {
  2018.         ImGui::Checkbox("Wallhack", &wall);
  2019.         ImGui::SameLine(300.f);
  2020.         if (ImGui::Button("Settings## Wallhack"))
  2021.         {
  2022.             wallhackmenu = !wallhackmenu;
  2023.         }
  2024.         if (wallhackmenu)
  2025.         {
  2026.             ImGui::SetNextWindowSize(ImVec2(310.0f, 300.0f));
  2027.             if (ImGui::Begin("Wallhack Settings", p_open = NULL, window_flags))
  2028.             {
  2029.                 ImGui::PushItemWidth(200.f);
  2030.                 ImGui::SliderInt("##5231", &whsize, 0, 100, ("Range"));
  2031.                 if (ImGui::Button("Hide", ImVec2(75.f, 20.f)))
  2032.                 {
  2033.                     wallhackmenu = !wallhackmenu;
  2034.                 }
  2035.                 ImGui::End();
  2036.             }
  2037.         }
  2038.         ImGui::Separator();
  2039.         ImGui::Checkbox("Time", &taim);
  2040.         ImGui::SameLine(300.f);
  2041.         if (ImGui::Button("Settings## Time"))
  2042.         {
  2043.             timemenu = !timemenu;
  2044.         }
  2045.         if (timemenu)
  2046.         {
  2047.             ImGui::SetNextWindowSize(ImVec2(310.0f, 300.0f));
  2048.             if (ImGui::Begin("Time Settings", p_open = NULL, window_flags))
  2049.             {
  2050.                 ImGui::PushItemWidth(200.f);
  2051.                 ImGui::SliderInt("##1", &timeset, 0, 24, "TIME");
  2052.                 if (ImGui::Button("Hide", ImVec2(75.f, 20.f)))
  2053.                 {
  2054.                     timemenu = !timemenu;
  2055.                 }
  2056.                 ImGui::End();
  2057.             }
  2058.         }
  2059.         ImGui::Checkbox("Weather", &weather);
  2060.         ImGui::SameLine(300.f);
  2061.         if (ImGui::Button("Settings## Weather"))
  2062.         {
  2063.             weathermenu = !weathermenu;
  2064.         }
  2065.         if (weathermenu)
  2066.         {
  2067.             ImGui::SetNextWindowSize(ImVec2(310.0f, 300.0f));
  2068.             if (ImGui::Begin("Weather Settings", p_open = NULL, window_flags))
  2069.             {
  2070.                 ImGui::PushItemWidth(200.f);
  2071.                 ImGui::SliderInt("##500", &weatherset, 0, 10, "WEATHER");
  2072.                 if (ImGui::Button("Hide", ImVec2(75.f, 20.f)))
  2073.                 {
  2074.                     weathermenu = !weathermenu;
  2075.                 }
  2076.                 ImGui::End();
  2077.             }
  2078.         }
  2079.         ImGui::Separator();
  2080.         ImGui::Checkbox("Thermal Vision", &thermalvisionvar);
  2081.         break;
  2082.     }
  2083.     case 3:
  2084.     {
  2085.         ImGui::Checkbox("Infinite Run", &c_infRun);
  2086.         ImGui::Checkbox("Mega Jump", &megajumpvar);
  2087.         ImGui::Checkbox("Fast Rotation", &rotationvar);
  2088.         ImGui::Checkbox("Infinite Oxygen", &ioxygen);
  2089.         ImGui::Checkbox("GodMode (UGBASE.EU)", &c_GodMode);
  2090.         ImGui::Checkbox("Anti Stun", &bAntiStun);
  2091.         ImGui::Checkbox("Teleport Map (F10)", &teleportmap);
  2092.         ImGui::Checkbox("Teleport CP (F11)", &teleportcp);
  2093.         ImGui::Checkbox("Slapper (F12)", &slapper);
  2094.         ImGui::Checkbox("Fake Kick", &fake_kick);
  2095.         break;
  2096.     }
  2097.     case 4:
  2098.     {
  2099.         ImGui::Checkbox("Tank Mode Car", &tankmodecar);
  2100.         ImGui::Checkbox("Nitro Car", &nitrocar);
  2101.         ImGui::Checkbox("WaterCar", &watercarvar);
  2102.         if (ImGui::Checkbox("Pro Driving", &pilot));
  2103.         if (pilot == true)
  2104.         {
  2105.             *(bool*)PILOT_ADDR = true;
  2106.         }
  2107.         else
  2108.         {
  2109.             *(bool*)PILOT_ADDR = false;
  2110.         }
  2111.         ImGui::Checkbox("Mega Jump Bike", &c_bjump);
  2112.         break;
  2113.     }
  2114.     case 5:
  2115.     {
  2116.         ImGui::Checkbox("Atentat", &atentat1);
  2117.         ImGui::Separator();
  2118.         ImGui::InputText("Mesajul pentru spam", cheat_spammer_text, sizeof(cheat_spammer_text));
  2119.         ImGui::InputInt("Delay (in ms)", &cheat_spammer_delay);
  2120.  
  2121.         if (cheat_enable_spammer)
  2122.         {
  2123.             if (ImGui::Button("Stop")) cheat_enable_spammer = false;
  2124.         }
  2125.         else
  2126.         {
  2127.             if (ImGui::Button("Start")) cheat_enable_spammer = true;
  2128.         }
  2129.         ImGui::Separator();
  2130.         ImGui::InputText("Local Nickname Changer", namechanger, sizeof(namechanger));
  2131.         if (ImGui::Button("CHANGE !")) namech = true;
  2132.         if (ImGui::Button("LCN STOP !")) namech = false;
  2133.         ImGui::Separator();
  2134.         ImGui::Checkbox("Fake Ping", &fake_ping);
  2135.         ImGui::SameLine(300.f);
  2136.         if (ImGui::Button("Settings## Fake Ping"))
  2137.         {
  2138.             fakepingmenu = !fakepingmenu;
  2139.         }
  2140.         if (fakepingmenu)
  2141.         {
  2142.             ImGui::SetNextWindowSize(ImVec2(310.0f, 300.0f));
  2143.             if (ImGui::Begin("Fake Ping Settings", p_open = NULL, window_flags))
  2144.             {
  2145.                 ImGui::PushItemWidth(200.f);
  2146.                 ImGui::SliderInt("##9234", &setfakeping, 500, 1000, "%.0f");
  2147.                 if (ImGui::Button("Hide", ImVec2(75.f, 20.f)))
  2148.                 {
  2149.                     fakepingmenu = !fakepingmenu;
  2150.                 }
  2151.                 ImGui::End();
  2152.             }
  2153.         }
  2154.         ImGui::Checkbox("Game Speed", &gamespeedvar1);
  2155.         ImGui::SameLine(300.f);
  2156.         if (ImGui::Button("Settings## Game Speed"))
  2157.         {
  2158.             gamespeedmenu = !gamespeedmenu;
  2159.         }
  2160.         if (gamespeedmenu)
  2161.         {
  2162.             ImGui::SetNextWindowSize(ImVec2(310.0f, 300.0f));
  2163.             if (ImGui::Begin("Game Speed Settings", p_open = NULL, window_flags))
  2164.             {
  2165.                 ImGui::PushItemWidth(200.f);
  2166.                 ImGui::SliderInt("##13374", &setgamespeed, 1, 100, "%.0f");
  2167.                 if (ImGui::Button("Hide", ImVec2(75.f, 20.f)))
  2168.                 {
  2169.                     gamespeedmenu = !gamespeedmenu;
  2170.                 }
  2171.                 ImGui::End();
  2172.             }
  2173.         }
  2174.         //
  2175.         ImGui::Checkbox("FPS Unlocker", &fpsunlockvar);
  2176.         break;
  2177.     }
  2178.     case 6:
  2179.     {
  2180.         if (ImGui::Button("Sync All"))
  2181.         {
  2182.             RainbowHud = true;
  2183.             culoare_pusa = true;
  2184.             rainbowmenu = true;
  2185.             tintarainbow = true;
  2186.             RainbowRadar = true;
  2187.             rainbowcarlight = true;
  2188.         }
  2189.         ImGui::SameLine(300.f);
  2190.         if (ImGui::Button("Settings## Rainbow"))
  2191.         {
  2192.             rainbowmenu2 = !rainbowmenu2;
  2193.         }
  2194.         if (rainbowmenu2)
  2195.         {
  2196.             ImGui::SetNextWindowSize(ImVec2(310.0f, 300.0f));
  2197.             if (ImGui::Begin("Rainbow Settings", p_open = NULL, window_flags))
  2198.             {
  2199.                 ImGui::PushItemWidth(200.f);
  2200.                 ImGui::SliderInt("Speed", &rrspeed, 0, 100, "%.0f%%");
  2201.                 if (ImGui::Button("Hide", ImVec2(75.f, 20.f)))
  2202.                 {
  2203.                     rainbowmenu2 = !rainbowmenu2;
  2204.                 }
  2205.                 ImGui::End();
  2206.             }
  2207.         }
  2208.         ImGui::Checkbox("Rainbow Hud", &RainbowHud);
  2209.         ImGui::Checkbox("Rainbow Car", &culoare_pusa);
  2210.         ImGui::Checkbox("Rainbow Menu", &rainbowmenu);
  2211.         ImGui::Checkbox("Rainbow Crosshair", &tintarainbow);
  2212.         ImGui::Checkbox("Rainbow Radar", &RainbowRadar);
  2213.         ImGui::Checkbox("Rainbow Car Lights", &rainbowcarlight);
  2214.         break;
  2215.     }
  2216.     case 7:
  2217.     {
  2218.         if (ImGui::Button("PANIC", ImVec2(100.f, 50.f)))
  2219.         {
  2220.             ImGui::OpenPopup("PANIC");
  2221.         }
  2222.         if (ImGui::BeginPopupModal("PANIC", p_open = NULL, window_flags_about))
  2223.         {
  2224.             ImGui::SetWindowSize(ImVec2(293.f, 80.f));
  2225.             ImGui::Text("Esti sigur ca doresti sa inchizi ASI-ul?");
  2226.             if (ImGui::Button("DA", ImVec2(135.f, 20.f)))
  2227.             {
  2228.                 Shutdown();
  2229.             }
  2230.             ImGui::SameLine();
  2231.             if (ImGui::Button("NU", ImVec2(135.f, 20.f)))
  2232.             {
  2233.                 ImGui::CloseCurrentPopup();
  2234.             }
  2235.             ImGui::EndPopup();
  2236.         }
  2237.         ImGui::SameLine();
  2238.         if (ImGui::Button("Auto Spawn", ImVec2(100.f, 50.f)))
  2239.         {
  2240.             if (pSAMP == NULL)
  2241.                 return;
  2242.  
  2243.             ((void(__thiscall *) (void *_this)) (g_dwSAMP_Addr + 0x3EC0)) (pSAMP->getPlayers()->pLocalPlayer);
  2244.             ((void(__thiscall *) (void *_this)) (g_dwSAMP_Addr + 0x3AD0)) (pSAMP->getPlayers()->pLocalPlayer);
  2245.         }
  2246.         ImGui::SameLine();
  2247.         if (ImGui::Button("Fake Death", ImVec2(100.f, 50.f)))
  2248.         {
  2249.             if (pSAMP == NULL)
  2250.                 return;
  2251.             ((void(__thiscall *) (void *)) (g_dwSAMP_Addr + 0x55E0))
  2252.                 (pSAMP->getPlayers()->pLocalPlayer);
  2253.         }
  2254.         ImGui::Checkbox("Upside", &upside);
  2255.         ImGui::Checkbox("Anti Aim", &ghostmode);
  2256.     }
  2257.     default:
  2258.         break;
  2259.     }
  2260.     ImGui::EndChild();
  2261.     ImGui::End();
  2262. }
  2263.  
  2264.  
  2265.  
  2266. void mainThread(void *pvParams)
  2267. {
  2268.    
  2269. }
  2270.  
  2271. void functions()
  2272. {
  2273.     //
  2274. }
  2275.  
  2276.  
  2277. HRESULT __stdcall Hooked_Present(IDirect3DDevice9 *pDevice, CONST RECT *pSrcRect, CONST RECT *pDestRect, HWND hDestWindow, CONST RGNDATA *pDirtyRegion)
  2278. {
  2279.     static float rainbow_color_redus;   //speed
  2280.     rainbow_color_redus += misc_RainbowSpeed = 0.0001 * rrspeed;
  2281.     if (rainbow_color_redus > 1.f) rainbow_color_redus = 0.f;
  2282.     DWORD rainbow_color_x = Color2::ToImColor(Color2::FromHSB(rainbow_color_redus, 1.f, 1.f));
  2283.     ImVec4 mainColorActive = Color2::ToImColor(Color2::FromHSB(rainbow_color_redus, 1.f, 1.f));
  2284.  
  2285.     if (RainbowHud)
  2286.     {
  2287.         *(DWORD*)(0xBAB22C) = rainbow_color_x;
  2288.         *(DWORD*)(0xBAB230) = rainbow_color_x;
  2289.         *(DWORD*)(0xBAB234) = rainbow_color_x;
  2290.         *(DWORD*)(0xBAB238) = rainbow_color_x;
  2291.         *(DWORD*)(0xBAB23C) = rainbow_color_x;
  2292.         *(DWORD*)(0xBAB260) = rainbow_color_x;
  2293.         *(DWORD*)(0xBAB240) = rainbow_color_x;
  2294.         *(DWORD*)(0xBAB244) = rainbow_color_x;
  2295.         *(DWORD*)(0xBAB248) = rainbow_color_x;
  2296.         *(DWORD*)(0xBAB24C) = rainbow_color_x;
  2297.         *(DWORD*)(0xBAB250) = rainbow_color_x;
  2298.         *(DWORD*)(0xBAB254) = rainbow_color_x;
  2299.         *(DWORD*)(0xBAB258) = rainbow_color_x;
  2300.         *(DWORD*)(0xBAB25C) = rainbow_color_x;
  2301.         *(DWORD*)(0xBAB260) = rainbow_color_x;
  2302.         //fist
  2303.         *(BYTE*)(0x58D973 + 1) = (BYTE)round(mainColorActive.x * 255.f);
  2304.         *(BYTE*)(0x58D96E + 1) = (BYTE)round(mainColorActive.y * 255.f);
  2305.         *(BYTE*)(0x58D969 + 1) = (BYTE)round(mainColorActive.z * 255.f);
  2306.  
  2307.         *(BYTE*)(0x58D8AF + 1) = (BYTE)round(mainColorActive.x * 255.f);
  2308.         *(BYTE*)(0x58D8AA + 1) = (BYTE)round(mainColorActive.y * 255.f);
  2309.         *(BYTE*)(0x58D89F + 1) = (BYTE)round(mainColorActive.z * 255.f);
  2310.         for (int i = 0; i < SAMP_MAX_TEXTDRAWS; i++)
  2311.         {
  2312.             if (pSAMP->getInfo()->pPools->pTextdraw->textdraw[i] == nullptr)
  2313.                 continue;
  2314.             pSAMP->getInfo()->pPools->pTextdraw->textdraw[i]->dwLetterColor = rainbow_color_x;
  2315.             //    pSAMP->getInfo()->pPools->pTextdraw->textdraw[i]->dwBoxColor = rainbow_color_x;
  2316.         }
  2317.  
  2318.         for (int i = 0; i < SAMP_MAX_PLAYERTEXTDRAWS; i++) {
  2319.             if (pSAMP->getInfo()->pPools->pTextdraw->playerTextdraw[i] == nullptr)
  2320.                 continue;
  2321.             pSAMP->getInfo()->pPools->pTextdraw->playerTextdraw[i]->dwLetterColor = rainbow_color_x;
  2322.             //    pSAMP->getInfo()->pPools->pTextdraw->playerTextdraw[i]->dwBoxColor = rainbow_color_x;
  2323.         }
  2324.     }
  2325.  
  2326.     if (RainbowHud == false)
  2327.     {
  2328.         *(DWORD*)(0xBAB22C) = 0xFF1D19B4;
  2329.         *(DWORD*)(0xBAB230) = 0xFF2C6836;
  2330.         *(DWORD*)(0xBAB234) = 0xFF7F3C32;
  2331.         *(DWORD*)(0xBAB238) = 0xFFF1CBAC;
  2332.         *(DWORD*)(0xBAB23C) = 0xFFE1E1E1;
  2333.         *(DWORD*)(0xBAB240) = 0xFF000000;
  2334.         *(DWORD*)(0xBAB244) = 0xFF106290;
  2335.         *(DWORD*)(0xBAB248) = 0xFFFC6EA8;
  2336.         *(DWORD*)(0xBAB24C) = 0xFF969696;
  2337.         *(DWORD*)(0xBAB250) = 0xFF110F68;
  2338.         *(DWORD*)(0xBAB254) = 0xFF1F4726;
  2339.         *(DWORD*)(0xBAB258) = 0xFF63C0E2;
  2340.         *(DWORD*)(0xBAB25C) = 0xFF6B5A4A;
  2341.         *(DWORD*)(0xBAB260) = 0xFFC81914;
  2342.         *(DWORD*)(0xBAB264) = 0xFF00FFFF;
  2343.  
  2344.         //fist
  2345.         *(BYTE*)(0x58D973 + 1) = 255;
  2346.         *(BYTE*)(0x58D96E + 1) = 255;
  2347.         *(BYTE*)(0x58D969 + 1) = 255;
  2348.  
  2349.         *(BYTE*)(0x58D8AF + 1) = 255;
  2350.         *(BYTE*)(0x58D8AA + 1) = 255;
  2351.         *(BYTE*)(0x58D89F + 1) = 255;
  2352.     }
  2353.  
  2354.     if (culoare_pusa)
  2355.     {
  2356.         if (*(DWORD*)0xBA18FC > 0) // car
  2357.         {
  2358.             *(byte*)(*(DWORD*)0xBA18FC + 1076) = 255;
  2359.             *(byte*)(*(DWORD*)0xBA18FC + 1077) = 255;
  2360.             *(byte*)(*(DWORD*)0xBA18FC + 1078) = 255;
  2361.             *(byte*)(*(DWORD*)0xBA18FC + 1079) = 255;
  2362.  
  2363.             *(DWORD*)((g_dwSAMP_Addr + 0x215AC8) + 4 * 255) = rainbow_color_x;
  2364.         }
  2365.     }
  2366.  
  2367.     if (rainbowmenu)
  2368.     {
  2369.         ImGuiStyle& style = ImGui::GetStyle();
  2370.         style.Colors[ImGuiCol_Text] = ImVec4(0.90f, 0.90f, 0.90f, 1.00f);
  2371.         style.Colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f);
  2372.         style.Colors[ImGuiCol_WindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.70f);
  2373.         style.Colors[ImGuiCol_ChildWindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
  2374.         style.Colors[ImGuiCol_PopupBg] = ImVec4(0.05f, 0.05f, 0.10f, 0.90f);
  2375.         style.Colors[ImGuiCol_Border] = mainColorActive;
  2376.         style.Colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
  2377.         style.Colors[ImGuiCol_FrameBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.30f);
  2378.         style.Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.90f, 0.80f, 0.80f, 0.40f);
  2379.         style.Colors[ImGuiCol_FrameBgActive] = ImVec4(0.90f, 0.65f, 0.65f, 0.45f);
  2380.         style.Colors[ImGuiCol_TitleBg] = mainColorActive;
  2381.         style.Colors[ImGuiCol_TitleBgCollapsed] = mainColorActive;
  2382.         style.Colors[ImGuiCol_TitleBgActive] = mainColorActive;
  2383.         style.Colors[ImGuiCol_MenuBarBg] = mainColorActive;
  2384.         style.Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.20f, 0.25f, 0.30f, 0.60f);
  2385.         style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.51f, 0.00f, 0.00f, 0.78f);
  2386.         style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.84f, 0.01f, 0.01f, 0.59f);
  2387.         style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(1.00f, 0.00f, 0.00f, 1.00f);
  2388.         style.Colors[ImGuiCol_ComboBg] = mainColorActive;
  2389.         style.Colors[ImGuiCol_CheckMark] = mainColorActive;
  2390.         style.Colors[ImGuiCol_SliderGrab] = mainColorActive;
  2391.         style.Colors[ImGuiCol_SliderGrabActive] = mainColorActive;
  2392.         style.Colors[ImGuiCol_Button] = mainColorActive;
  2393.         style.Colors[ImGuiCol_ButtonHovered] = mainColorActive;
  2394.         style.Colors[ImGuiCol_ButtonActive] = mainColorActive;;
  2395.         style.Colors[ImGuiCol_Header] = mainColorActive;
  2396.         style.Colors[ImGuiCol_HeaderHovered] = mainColorActive;
  2397.         style.Colors[ImGuiCol_HeaderActive] = mainColorActive;
  2398.         style.Colors[ImGuiCol_Column] = ImVec4(0.50f, 0.50f, 0.50f, 1.00f);
  2399.         style.Colors[ImGuiCol_ColumnHovered] = ImVec4(0.70f, 0.60f, 0.60f, 1.00f);
  2400.         style.Colors[ImGuiCol_ColumnActive] = ImVec4(0.90f, 0.70f, 0.70f, 1.00f);
  2401.         style.Colors[ImGuiCol_ResizeGrip] = ImVec4(1.00f, 1.00f, 1.00f, 0.30f);
  2402.         style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(1.00f, 1.00f, 1.00f, 0.60f);
  2403.         style.Colors[ImGuiCol_ResizeGripActive] = ImVec4(1.00f, 1.00f, 1.00f, 0.90f);
  2404.         style.Colors[ImGuiCol_CloseButton] = ImVec4(0.50f, 0.50f, 0.90f, 0.50f);
  2405.         style.Colors[ImGuiCol_CloseButtonHovered] = ImVec4(0.70f, 0.70f, 0.90f, 0.60f);
  2406.         style.Colors[ImGuiCol_CloseButtonActive] = ImVec4(0.70f, 0.70f, 0.70f, 1.00f);
  2407.         style.Colors[ImGuiCol_PlotLines] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
  2408.         style.Colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
  2409.         style.Colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
  2410.         style.Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f);
  2411.         style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.00f, 0.00f, 1.00f, 0.35f);
  2412.         style.Colors[ImGuiCol_ModalWindowDarkening] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f);
  2413.         //style.WindowTitleAlign = ImVec2(0.5f, 0.5f);
  2414.         style.WindowTitleAlign = ImGuiAlign_Center;
  2415.         defaulttheme = false;
  2416.     }
  2417.  
  2418.     //Tinta Rainbow
  2419.  
  2420.     if (tintarainbow)
  2421.     {
  2422.         // partea dreapta jos
  2423.         *(BYTE*)0x58E47C = (BYTE)round(mainColorActive.x * 255.f);
  2424.         *(BYTE*)0x58E473 = (BYTE)round(mainColorActive.y * 255.f);
  2425.         *(BYTE*)0x58E466 = (BYTE)round(mainColorActive.z * 255.f);
  2426.         // partea dreapta jos
  2427.         *(BYTE*)(0x58E432 + 1) = (BYTE)round(mainColorActive.x * 255.f);
  2428.         *(BYTE*)(0x58E429 + 1) = (BYTE)round(mainColorActive.y * 255.f);
  2429.         *(BYTE*)(0x58E424 + 1) = (BYTE)round(mainColorActive.z * 255.f);
  2430.  
  2431.         *(BYTE*)(0x58E3D9 + 1) = (BYTE)round(mainColorActive.x * 255.f);
  2432.         *(BYTE*)(0x58E3D0 + 1) = (BYTE)round(mainColorActive.y * 255.f);
  2433.         *(BYTE*)(0x58E3C7 + 1) = (BYTE)round(mainColorActive.z * 255.f);
  2434.  
  2435.         *(BYTE*)(0x58E300 + 1) = (BYTE)round(mainColorActive.x * 255.f);
  2436.         *(BYTE*)(0x58E2F5 + 1) = (BYTE)round(mainColorActive.y * 255.f);
  2437.         *(BYTE*)(0x58E2F0 + 1) = (BYTE)round(mainColorActive.z * 255.f);
  2438.     }
  2439.     if (tintarainbow == false)
  2440.     {
  2441.         // partea dreapta jos
  2442.         *(BYTE*)0x58E47C = 255;
  2443.         *(BYTE*)0x58E473 = 255;
  2444.         *(BYTE*)0x58E466 = 255;
  2445.         // partea dreapta jos
  2446.         *(BYTE*)(0x58E432 + 1) = 255;
  2447.         *(BYTE*)(0x58E429 + 1) = 255;
  2448.         *(BYTE*)(0x58E424 + 1) = 255;
  2449.  
  2450.         *(BYTE*)(0x58E3D9 + 1) = 255;
  2451.         *(BYTE*)(0x58E3D0 + 1) = 255;
  2452.         *(BYTE*)(0x58E3C7 + 1) = 255;
  2453.  
  2454.         *(BYTE*)(0x58E300 + 1) = 255;
  2455.         *(BYTE*)(0x58E2F5 + 1) = 255;
  2456.         *(BYTE*)(0x58E2F0 + 1) = 255;
  2457.     }
  2458.     //Tinta Rainbow
  2459.  
  2460.     // RADAR RAINBOW
  2461.  
  2462.     if (RainbowRadar)
  2463.     {
  2464.         *(BYTE*)(0x58A9A2) = (BYTE)round(mainColorActive.x * 255.f);
  2465.         *(BYTE*)(0x58A99A) = (BYTE)round(mainColorActive.y * 255.f);
  2466.         *(BYTE*)(0x58A996) = (BYTE)round(mainColorActive.z * 240.f);
  2467.  
  2468.         *(BYTE*)(0x58A8EE) = (BYTE)round(mainColorActive.x * 255.f);
  2469.         *(BYTE*)(0x58A8E6) = (BYTE)round(mainColorActive.y * 255.f);
  2470.         *(BYTE*)(0x58A8DE) = (BYTE)round(mainColorActive.z * 255.f);
  2471.  
  2472.         *(BYTE*)(0x58A89A) = (BYTE)round(mainColorActive.x * 255.f);
  2473.         *(BYTE*)(0x58A896) = (BYTE)round(mainColorActive.y * 255.f);
  2474.         *(BYTE*)(0x58A894) = (BYTE)round(mainColorActive.z * 255.f);
  2475.  
  2476.         *(BYTE*)(0x58A798) = (BYTE)round(mainColorActive.x * 255.f);
  2477.         *(BYTE*)(0x58A790) = (BYTE)round(mainColorActive.y * 255.f);
  2478.         *(BYTE*)(0x58A78E) = (BYTE)round(mainColorActive.z * 255.f);
  2479.  
  2480.         *(BYTE*)(0x582F20) = (BYTE)round(mainColorActive.x * 255.f);
  2481.         *(BYTE*)(0x582F1A) = (BYTE)round(mainColorActive.y * 255.f);
  2482.         *(BYTE*)(0x582F18) = (BYTE)round(mainColorActive.z * 255.f);
  2483.  
  2484.         *(BYTE*)(0x588690 + 1) = (BYTE)round(mainColorActive.x * 255.f);
  2485.         *(BYTE*)(0x58868B + 1) = (BYTE)round(mainColorActive.y * 255.f);
  2486.         *(BYTE*)(0x588686 + 1) = (BYTE)round(mainColorActive.z * 255.f);
  2487.  
  2488.         *(byte*)(0x5860CC + 1) = (BYTE)round(mainColorActive.x * 255.f);
  2489.         *(byte*)(0x5860C1 + 1) = (BYTE)round(mainColorActive.y * 255.f);
  2490.         *(byte*)(0x5860BC + 1) = (BYTE)round(mainColorActive.z * 255.f);
  2491.     }
  2492.  
  2493.     if (RainbowRadar == false)
  2494.     {
  2495.         *(BYTE*)(0x58A9A2) = 0;
  2496.         *(BYTE*)(0x58A99A) = 0;
  2497.         *(BYTE*)(0x58A996) = 0;
  2498.  
  2499.         *(BYTE*)(0x58A8EE) = 0;
  2500.         *(BYTE*)(0x58A8E6) = 0;
  2501.         *(BYTE*)(0x58A8DE) = 0;
  2502.  
  2503.         *(BYTE*)(0x58A89A) = 0;
  2504.         *(BYTE*)(0x58A896) = 0;
  2505.         *(BYTE*)(0x58A894) = 0;
  2506.  
  2507.         *(BYTE*)(0x58A798) = 0;
  2508.         *(BYTE*)(0x58A790) = 0;
  2509.         *(BYTE*)(0x58A78E) = 0;
  2510.  
  2511.         *(BYTE*)(0x582F20) = 0;
  2512.         *(BYTE*)(0x582F1A) = 0;
  2513.         *(BYTE*)(0x582F18) = 0;
  2514.  
  2515.         *(BYTE*)(0x588690 + 1) = 255;
  2516.         *(BYTE*)(0x58868B + 1) = 255;
  2517.         *(BYTE*)(0x588686 + 1) = 255;
  2518.  
  2519.         *(byte*)(0x5860CC + 1) = 255;
  2520.         *(byte*)(0x5860C1 + 1) = 255;
  2521.         *(byte*)(0x5860BC + 1) = 255;
  2522.     }
  2523.  
  2524.     //RAINBOW RADAR
  2525.  
  2526.  
  2527.     if (rainbowcarlight)
  2528.     {
  2529.         *(byte*)(0x6E155F + 1) = (BYTE)round(mainColorActive.x * 255.f);
  2530.         *(byte*)(0x6E155D + 1) = (BYTE)round(mainColorActive.y * 255.f);
  2531.         *(byte*)(0x6E1555 + 1) = (BYTE)round(mainColorActive.z * 255.f);
  2532.  
  2533.         *(byte*)(0x6E1688 + 1) = (BYTE)round(mainColorActive.x * 255.f);
  2534.         *(byte*)(0x6E1686 + 1) = (BYTE)round(mainColorActive.y * 255.f);
  2535.         *(byte*)(0x6E1684 + 1) = (BYTE)round(mainColorActive.z * 255.f);
  2536.     }
  2537.     if (rainbowcarlight == false)
  2538.     {
  2539.         *(byte*)(0x6E155F + 1) = 45;
  2540.         *(byte*)(0x6E155D + 1) = 45;
  2541.         *(byte*)(0x6E1555 + 1) = 45;
  2542.  
  2543.         *(byte*)(0x6E1688 + 1) = 45;
  2544.         *(byte*)(0x6E1686 + 1) = 45;
  2545.         *(byte*)(0x6E1684 + 1) = 45;
  2546.     }
  2547.  
  2548.     if (rainbowmenu == false)
  2549.     {
  2550.         Pleata();
  2551.         defaulttheme = true;
  2552.     }
  2553.  
  2554.     if (!pDevice)
  2555.         return pD3DHook->Orginal_Present(pDevice, pSrcRect, pDestRect, hDestWindow, pDirtyRegion);
  2556.  
  2557.     if (pD3DHook->bD3DRenderInit == false)
  2558.     {
  2559.         pD3DHook->pRender->Initialize(pDevice);
  2560.         pD3DHook->pD3DFont->Initialize(pDevice);
  2561.  
  2562.         pD3DHook->bD3DRenderInit = true;
  2563.     }
  2564.  
  2565.     if (!pSAMP->isInited)
  2566.         pD3DHook->pD3DFont->Print(1, 1, D3DCOLOR_ARGB(255, rand() % 255, rand() % 255, rand() % 255), "", true);
  2567.  
  2568.     return pD3DHook->Orginal_Present(pDevice, pSrcRect, pDestRect, hDestWindow, pDirtyRegion);
  2569. }
  2570.  
  2571. LRESULT CALLBACK hWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
  2572. {
  2573.     if (ImGui_ImplDX9_WndProcHandler(hwnd, uMsg, wParam, lParam) && GetKeyState(key) == 1 && menuOpen && wndproc)
  2574.     {
  2575.         return 1l;
  2576.     }
  2577.  
  2578.     return CallWindowProc(oriWndProc, hwnd, uMsg, wParam, lParam);
  2579. }
  2580.  
  2581. HRESULT __stdcall hkReset(IDirect3DDevice9* pDevice, D3DPRESENT_PARAMETERS* pp)
  2582. {
  2583.     if (g_bwasInitialized)
  2584.     {
  2585.         ImGui_ImplDX9_InvalidateDeviceObjects();
  2586.         g_bwasInitialized = false;
  2587.     }
  2588.     return oReset(pDevice, pp);
  2589. }
  2590.  
  2591. HRESULT __stdcall hkEndScene(IDirect3DDevice9* pDevice)
  2592. {
  2593.  
  2594.     if (defaulttheme)
  2595.     {
  2596.         Pleata();
  2597.     }
  2598.  
  2599.     if (taim)
  2600.     {
  2601.         *(DWORD*)(0xB70153) = timeset;
  2602.     }
  2603.     if (!taim)
  2604.     {
  2605.         *(DWORD*)(0xB70153) = 12;
  2606.     }
  2607.     if (weather)
  2608.     {
  2609.         *(DWORD*)(0xC81320) = weatherset;
  2610.     }
  2611.     if (!weather)
  2612.     {
  2613.         *(DWORD*)(0xC81320) = 12;
  2614.     }
  2615.  
  2616.     if (!g_bwasInitialized)
  2617.     {
  2618.         ImGuiIO& io = ImGui::GetIO();
  2619.         ImGuiStyle& style = ImGui::GetStyle();
  2620.         io.IniFilename = NULL;
  2621.         io.DeltaTime = 1.0f / 60.0f;
  2622.         ImFont* pFont = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\arialbd.ttf", 13);
  2623.         D3DDEVICE_CREATION_PARAMETERS d3dcp;
  2624.         pDevice->GetCreationParameters(&d3dcp);
  2625.         hWnd = d3dcp.hFocusWindow;
  2626.         io.Fonts->AddFontDefault();
  2627.         style.AntiAliasedLines = false;
  2628.         style.AntiAliasedShapes = false;
  2629.         if (hwndd == 0)
  2630.         {
  2631.             oriWndProc = (WNDPROC)SetWindowLongPtr(d3dcp.hFocusWindow,
  2632.                 GWL_WNDPROC, (LONG)(LONG_PTR)hWndProc);
  2633.             hwndd++;
  2634.         }
  2635.         ImGui_ImplDX9_Init(d3dcp.hFocusWindow, pDevice);
  2636.         g_bwasInitialized = true;
  2637.     }
  2638.     if (startmenu == 0)
  2639.     {
  2640.         key = VK_INSERT;
  2641.     }
  2642.     if (startmenu == 1)
  2643.     {
  2644.         key = VK_HOME;
  2645.     }
  2646.     if (startmenu == 2)
  2647.     {
  2648.         key = VK_DELETE;
  2649.     }
  2650.     if (startmenu == 3)
  2651.     {
  2652.         key = VK_END;
  2653.     }
  2654.     ImGui_ImplDX9_NewFrame();
  2655.     if (menuOpen)
  2656.     {
  2657.         toggleSAMPCursor(1);
  2658.         toggleChat(1);
  2659.         RenderGUI();
  2660.     }
  2661.     else
  2662.     {
  2663.         if (startstop == 0)
  2664.         {
  2665.             toggleSAMPCursor(0);
  2666.             toggleChat(0);
  2667.             startstop++;
  2668.         }
  2669.     }
  2670.     ImGui::Render();
  2671.     return oEndScene(pDevice);
  2672. }
  2673. DWORD APIENTRY MainThread(LPVOID lparam)
  2674. {
  2675.     if (pSAMP)
  2676.     {
  2677.         while (g_dwSAMP_Addr == NULL)
  2678.         {
  2679.             g_dwSAMP_Addr = (DWORD)GetModuleHandle("samp.dll");
  2680.             sleep(250);
  2681.         }
  2682.  
  2683.         while (!g_Chat)
  2684.         {
  2685.             g_Chat = *(DWORD**)(g_dwSAMP_Addr + SAMP_CHAT_INFO_OFFSET);
  2686.             sleep(25);
  2687.         }
  2688.  
  2689.         while (!pSAMP->tryInit())
  2690.             Sleep(100);
  2691.     }
  2692.  
  2693.     void** vTableDevice = *(void***)(*(DWORD*)DEVICE_PTR);
  2694.     VTableHookManager* vmtHooks = new VTableHookManager(vTableDevice, D3D_VFUNCTIONS);
  2695.  
  2696.     oEndScene = (_EndScene)vmtHooks->Hook(ENDSCENE_INDEX, (void*)hkEndScene);
  2697.     oReset = (_Reset)vmtHooks->Hook(RESET_INDEX, (void*)hkReset);
  2698.  
  2699.     everything();
  2700.     while (true)
  2701.     {
  2702.         if (GetAsyncKeyState(key) & 1)
  2703.         {
  2704.             menuOpen = !menuOpen;
  2705.             startstop = 0;
  2706.         }
  2707.         if (close == 1)
  2708.         {
  2709.             return 0;
  2710.         }
  2711.         Functions();
  2712.         Fakekick();
  2713.         MouseFix();
  2714.     }
  2715. }
  2716.  
  2717. BOOL APIENTRY DllMain(HMODULE hModule,
  2718.     DWORD  ul_reason_for_call,
  2719.     LPVOID lpReserved
  2720. )
  2721.  
  2722. {
  2723.     switch (ul_reason_for_call)
  2724.     {
  2725.     case DLL_PROCESS_ATTACH:
  2726.         CreateThread(0, 0, MainThread, hModule, 0, 0);
  2727.  
  2728.         pSAMP = new SAMPFramework(GetModuleHandle("samp.dll"));
  2729.         _beginthread(mainThread, NULL, NULL);
  2730.         pD3DHook = new CD3DHook();
  2731.         break;
  2732.         break;
  2733.     case DLL_THREAD_ATTACH:
  2734.     case DLL_THREAD_DETACH:
  2735.     case DLL_PROCESS_DETACH:
  2736.         break;
  2737.     }
  2738.     return TRUE;
  2739. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement