public override void OnUpdaterTick()
        {
            if (Program.GameImplementation == null)
            {
                return;
            }
            if (Program.GameController == null)
            {
                return;
            }
            if (!Program.GameController.IsGameRunning)
            {
                return;
            }
            csgo = (CSGOImplementation)Program.GameImplementation;
            CSGOGameController csgoController = (CSGOGameController)Program.GameController;

            if (csgo.SignOnState != SignOnState.SIGNONSTATE_FULL)
            {
                return;
            }
            if (csgoController.MemoryUpdater.Tick == lastTick)
            {
                return;
            }
            lastTick = csgoController.MemoryUpdater.Tick;

            if (csgo.LocalPlayer == null)
            {
                return;
            }
            if (csgo.LocalPlayer.Health <= 0)
            {
                return;
            }
            if ((csgo.WeaponType == WeaponType.Grenade || csgo.WeaponType == WeaponType.Melee || csgo.WeaponType == WeaponType.Special))
            {
                return;
            }
            if (csgo.WeaponClip1 <= 0)
            {
                return;
            }
            if (csgo.IsReloading)
            {
                return;
            }

            bool rcsCompensateOn               = csgo.GetValue <OnOff>("aimbotCompensateRecoil") == OnOff.On;
            CSGOGameController controller      = (CSGOGameController)Program.GameController;
            Vector3            rcsCompensation = Vector3.Zero;

            controller.RecoilControl.IsActive = lastTarget == null;

            if (csgo.GetValue <YesNo>("aimbotEnabled") == YesNo.No)
            {
                return;
            }
            if (csgo.GetValue <YesNo>("spectatorDisableAim") == YesNo.Yes && csgo.FirstPersonSpectator)
            {
                return;
            }

            //Aimkey not down
            //-> Reset target
            if (!Program.GameController.InputUpdater.KeyIsDown(Program.GameImplementation.GetValue <Keys>("aimbotKey")))
            {
                lastTarget  = null;
                lastAimBone = (AimBone)(((int)lastAimBone + 1) % 9);
                return;
            }

            //Aimkey down but dead target
            //-> Release key to reset target
            if (lastTarget != null)
            {
                if (!lastTarget.IsValid())
                {
                    if (csgo.GetValue <YesNo>("aimAllowAimJump") == YesNo.No)
                    {
                        return;
                    }
                }
            }

            Vector2 screenM = new Vector2(csgo.ScreenSize.Width / 2f, csgo.ScreenSize.Height / 2f);
            AimBone bone    = csgo.GetValue <AimBone>("aimbotBone");

            if (bone != lastAimBone)
            {
                lastAimBone = bone;
                if (IsRandomAimBone(lastAimBone))
                {
                    randomAimBone = GetRandomBone(bone);
                }
                ;
            }
            if (IsRandomAimBone(bone))
            {
                bone = randomAimBone;
            }
            //Aimkey down but no target
            //-> Get new target
            if (lastTarget == null || (lastTarget != null && !lastTarget.IsValid()) || csgo.GetValue <YesNo>("aimAllowAimJump") == YesNo.Yes)
            {
                Target    target = csgo.GetValue <Target>("aimbotTarget");
                AimMethod method = csgo.GetValue <AimMethod>("aimbotMethod");
                float     radius = csgo.GetValue <float>("aimbotRadius");

                if (csgo.GetValue <OnOff>("aimbotRagemode") == OnOff.On)
                {
                    currentImplementation = rageMode;
                }
                else
                {
                    switch (method)
                    {
                    case AimMethod.LowestHP:
                        currentImplementation = lowestHP;
                        break;

                    case AimMethod.NearestToCrosshair:
                        currentImplementation = nearestToCrosshair;
                        break;

                    case AimMethod.NearestToPlayer:
                        currentImplementation = nearestToPlayer;
                        break;
                    }
                }
                lastTarget = currentImplementation.GetAimTarget(csgo, target, bone, screenM, radius);
            }
            //No target found?
            //-> Break.
            if (lastTarget == null || (lastTarget != null && !lastTarget.IsValid()))
            {
                return;
            }

            //Vector2 aimPos = currentImplementation.AimAt(csgo, bone, csgo.GetPlayerByIndex(lastTarget.PlayerIndex));
            //if (aimPos != lastPoint && aimPos != Vector2.Zero)
            //{
            if (csgo.ViewAngles == Vector3.Zero)
            {
                return;
            }
            Vector3 viewAngles = csgo.ViewAngles;

            viewAngles = Geometry.CalcAngle(csgo.LocalPlayer.Vector3 + csgo.ViewOffset, csgo.Players[lastTarget.PlayerIndex - 1].Skeleton.GetBone(bone));
            if (rcsCompensateOn)
            {
                viewAngles = viewAngles - csgo.LocalPlayer.PunchVector * 2;
            }

            if (csgo.GetValue <OnOff>("aimbotSmooth") == OnOff.On)
            {
                Vector3 smoothed = viewAngles - csgo.ViewAngles;
                smoothed *= csgo.GetValue <float>("aimbotSpeed") / 100f;
                if (Math.Abs(smoothed.Y) < 45)
                {
                    viewAngles = csgo.ViewAngles + smoothed;
                }
            }
            viewAngles.Z = 0f;
            viewAngles   = Geometry.ClampAngle(viewAngles);
            ((CSGOGameController)Program.GameController).MemoryUpdater.WriteViewAngles(viewAngles);
            //}
        }
        protected override void OnDraw(SharpDX.Direct2D1.WindowRenderTarget device)
        {
            csgo = (CSGOImplementation)Program.GameImplementation;
            if (csgo == null)
            {
                return;
            }
            CSGOGameController csController  = (CSGOGameController)Program.GameController;
            Player             currentPlayer = csgo.GetCurrentPlayer();

            if (currentPlayer == null)
            {
                return;
            }

            float screenW = csgo.ScreenSize.Width / 2f, screenH = csgo.ScreenSize.Height / 2f;//, width = 64;
            float multiplier = GetColorMultiplier();

            #region aimbot radius
            if (Program.GameImplementation.GetValue <YesNo>("aimbotEnabled") == YesNo.Yes)
            {
                float aimRadius = Program.GameImplementation.GetValue <float>("aimbotRadius");
                FillEllipse(device,
                            aimBackColor,
                            screenW,
                            screenH,
                            aimRadius * 2,
                            aimRadius * 2,
                            true
                            );
                DrawEllipse(device,
                            backColor,
                            screenW,
                            screenH,
                            aimRadius * 2,
                            aimRadius * 2,
                            true
                            );
            }
            #endregion
            #region soundesp
            if (Program.GameImplementation.GetValue <YesNo>("crosshairDrawSoundESP") == YesNo.Yes)
            {
                if (csController.SoundESP.LastPercent != 0f)
                {
                    float size = 250f * csController.SoundESP.LastPercent / 100f;
                    DrawEllipse(device, aimBackColor, screenW, screenH, size, size, true, 2f);
                }
            }
            #endregion
            #region recoil
            if (Program.GameImplementation.GetValue <YesNo>("crosshairDrawRecoil") == YesNo.Yes)
            {
                if (csgo.LocalPlayer.PunchVector.Length() != 0f)
                {
                    float x  = Program.GameController.Form.Width / 2f;
                    float y  = Program.GameController.Form.Height / 2f;
                    float dy = Program.GameController.Form.Height / 90f;
                    float dx = Program.GameController.Form.Width / 90f;
                    x -= (dx * (csgo.LocalPlayer.PunchVector.Y));
                    y += (dy * (csgo.LocalPlayer.PunchVector.X));

                    //float pixelPerDeg = 1680f / 90f;
                    //float distX = csgo.LocalPlayer.PunchVector.Y * 2;
                    //float distY = csgo.LocalPlayer.PunchVector.X * 2 * -1f;
                    //float x = csgo.ScreenSize.Width / 2f - distX * pixelPerDeg;
                    //float y = csgo.ScreenSize.Height / 2f - distY * pixelPerDeg;
                    DrawLine(device, colorT * 0.5f, x - 16f, y, x + 16f, y, 4f);
                    DrawLine(device, colorT * 0.5f, x, y - 16f, x, y + 16f, 4f);
                }
            }
            #endregion
            #region spectator
            if (Program.GameImplementation.GetValue <YesNo>("spectatorDrawWarning") == YesNo.Yes)
            {
                float height = 22f + 20f * csgo.Spectators.Count;
                float specx = screenW - specPanelWidth / 2f, specy = csgo.ScreenSize.Height - 4 - height;

                if (csgo.Spectators.Count > 0)
                {
                    FillRectangle(device,
                                  aimBackColor,
                                  specx,
                                  specy,
                                  specPanelWidth,
                                  height
                                  );
                    FillRectangle(device,
                                  aimBackColor,
                                  specx,
                                  specy,
                                  specPanelWidth,
                                  height
                                  );
                    DrawText(device,
                             colorT,
                             backColor,
                             specx + specPanelMarginNames,
                             specy + 2,
                             100,
                             20,
                             1,
                             1,
                             "Spectators:",
                             FactoryManager.GetFont("largeSegoe"));
                }
                for (int i = 0; i < csgo.Spectators.Count; i++)
                {
                    try
                    {
                        DrawText(device,
                                 csgo.Spectators[i].SpectatorView == Data.Enums.SpectatorView.Ego ?
                                 colorT * (0.75f + 0.25f * multiplier) :
                                 colorT,
                                 backColor,
                                 specx + specPanelMarginNames,
                                 specy + 2f + (i + 1) * 20f,
                                 256,
                                 20,
                                 1,
                                 1,
                                 String.Format("{0} ({1})", csgo.Spectators[i].Name, csgo.Spectators[i].SpectatorView),
                                 FactoryManager.GetFont("smallSegoe"));
                        if (csgo.Spectators[i].SpectatorView == Data.Enums.SpectatorView.Ego)
                        {
                            DrawText(device,
                                     colorT * (0.75f + 0.25f * multiplier),
                                     backColor,
                                     specx - specPanelExclMrk,
                                     specy + 2f + (i + 1) * 20f,
                                     24f,
                                     20,
                                     1,
                                     1,
                                     "!",
                                     FactoryManager.GetFont("smallSegoe"));
                        }
                    }
                    catch { }
                }
            }
            #endregion
            #region crosshair
            if (Program.GameImplementation.GetValue <YesNo>("crosshairEnabled") == YesNo.Yes)
            {
                float inaccuracy = 0f;
                Color drawColor  = backColor;
                if (csgo.TargetPlayer != null)
                {
                    Entity targetPlayer = (Entity)csgo.TargetPlayer.Clone();
                    drawColor = targetPlayer.InTeam == Data.Team.CounterTerrorists ? colorCT : colorT;
                    DrawText(device,
                             foreColor,
                             backColor,
                             screenW + 2f,
                             screenH + 2f,
                             100f,
                             20f,
                             1f,
                             1f,
                             targetPlayer.Name,
                             FactoryManager.GetFont("smallSegoe"));
                    DrawText(device,
                             foreColor,
                             backColor,
                             screenW + 2f,
                             screenH - 20f,
                             100f,
                             20f,
                             1f,
                             1f,
                             targetPlayer.Health.ToString() + "HP",
                             FactoryManager.GetFont("smallSegoe"));
                }
                if (csgo.AccuracyPenality > 0.0f)
                {
                    inaccuracy = csgo.AccuracyPenality / 0.002f;
                    DrawEllipse(device,
                                drawColor * 0.25f,
                                screenW,
                                screenH,
                                4f * inaccuracy,
                                4f * inaccuracy,
                                true
                                );
                }
                //Left
                DrawLine(device,
                         drawColor,
                         screenW - xhairWidth / 2f,
                         screenH,
                         screenW + xhairWidth / 2f,
                         screenH,
                         1f);
                //Top
                DrawLine(device,
                         drawColor,
                         screenW,
                         screenH - xhairWidth / 2f,
                         screenW,
                         screenH + xhairWidth / 2f,
                         1f);
                if (inaccuracy > 0f)
                {
                    float bar = xhairWidth / 16f * inaccuracy * 0.50f;
                    if (bar > xhairWidth / 2f)
                    {
                        bar = xhairWidth / 2f;
                    }
                    //Left
                    DrawLine(device,
                             drawColor,
                             screenW - 2f * inaccuracy,
                             screenH - bar / 2f,
                             screenW - 2f * inaccuracy,
                             screenH + bar / 2f,
                             2f);
                    //Right
                    DrawLine(device,
                             drawColor,
                             screenW + 2f * inaccuracy,
                             screenH - bar / 2f,
                             screenW + 2f * inaccuracy,
                             screenH + bar / 2f,
                             2f);
                    //Up
                    DrawLine(device,
                             drawColor,
                             screenW - bar / 2f,
                             screenH - 2f * inaccuracy,
                             screenW + bar / 2f,
                             screenH - 2f * inaccuracy,
                             2f);
                    //Down
                    DrawLine(device,
                             drawColor,
                             screenW - bar / 2f,
                             screenH + 2f * inaccuracy,
                             screenW + bar / 2f,
                             screenH + 2f * inaccuracy,
                             2f);
                }
            }
            #endregion
            #region spotted
            if (currentPlayer != null)
            {
                if (currentPlayer.IsSpotted)
                {
                    DrawEllipse(device,
                                colorT * (0.5f + 0.5f * multiplier),
                                screenW,
                                screenH,
                                xhairWidth,
                                xhairWidth,
                                true,
                                3f);
                }
            }
            #endregion
        }
Example #3
0
        private void DrawEntity(WindowRenderTarget device, Player currentPlayer, Entity entity)
        {
            if (entity == null)
            {
                return;
            }
            if (entity.Address == currentPlayer.Address)
            {
                return;
            }
            if (!entity.IsValid())
            {
                return;
            }
            //if (!Geometry.PointSeesPoint(currentPlayer.Vector2, entity.Vector2, Player.FOV_DEGREE, currentPlayer.Yaw))
            //    return;

            Color   brushColor = lifeBarForeground;
            Vector2 point      = Geometry.WorldToScreen(csgo.ViewMatrix, csgo.ScreenSize, entity.Vector3);

            if (point == Vector2.Zero)
            {
                return;
            }
            Vector3 entPoint = entity.Vector3;
            float   distance = Geometry.GetDistanceToPoint(currentPlayer.Vector3, entity.Vector3);
            float   distanceMeter = currentPlayer.DistanceToOtherEntityInMetres(entity);
            float   boxBorder = 6400f / distance;
            float   scale = 0.5f / distanceMeter;
            float   rectX = point.X, rectY = point.Y, rectW = 24f * scale, rectH = 24f * scale;

            switch (entity.ClassID)
            {
            case Data.Enums.ClassID.Weapon:
                brushColor = Color.Green;
                if (csgo.GetValue <YesNo>("espDrawWeapons") == YesNo.No)
                {
                    return;
                }
                if (entity.OwnerEntity != -1)
                {
                    return;
                }
                break;

            case Data.Enums.ClassID.Hostage:
                brushColor = Color.LemonChiffon;
                return;

            case Data.Enums.ClassID.C4:
                if (currentPlayer.Index == entity.OwnerEntity)
                {
                    return;
                }
                brushColor = Color.DarkRed;
                //if (entity.OwnerEntity > -1 && entity.OwnerEntity < csgo.Players.Length - 1)
                //{
                //    point = Geometry.WorldToScreen(csgo.ViewMatrix, csgo.ScreenSize, csgo.Players[entity.OwnerEntity - 1].Skeleton.Spine4);
                //    rectX = point.X;
                //    rectY = point.Y;
                //    FillEllipse(device, Color.DarkRed * 0.25f, point.X, point.Y, csgo.ScreenSize.Height / 2f, csgo.ScreenSize.Height / 2f, true);
                //    entPoint = csgo.Players[entity.OwnerEntity - 1].Skeleton.Spine4;
                //}
                break;

            case Data.Enums.ClassID.PlantedC4:
                brushColor = Color.DarkRed;
                //FillEllipse(device, Color.DarkRed * 0.25f, point.X, point.Y, csgo.ScreenSize.Height / 2f, csgo.ScreenSize.Height / 2f, true);
                break;

            default:
                return;
            }
            if (entity.ClassID == Data.Enums.ClassID.Chicken || entity.ClassID == Data.Enums.ClassID.Hostage)
            {
                //Paint bones
                //List<Vector3> allBones = new List<Vector3>();
                //if (distanceMeter < 20)
                //    allBones.AddRange(entity.Skeleton.Arms);
                //allBones.AddRange(entity.Skeleton.Legs);
                //allBones.AddRange(entity.Skeleton.Spine);
                //allBones.Add(entity.Skeleton.Neck);
                //for (int i = allBones.Count - 1; i >= 0; i--)
                //    if (allBones[i] == Vector3.Zero)
                //        allBones.RemoveAt(i);

                //Vector2[] all = Geometry.WorldToScreen(csgo.ViewMatrix, csgo.ScreenSize, allBones.ToArray());
                //allBones.Clear();
                //allBones = null;

                //rectX = GetSmallestX(all);
                //rectW = GetBiggestX(all);
                //rectY = GetSmallestY(all);
                //rectH = GetBiggestY(all);
                //rectW -= rectX;
                //rectH -= rectY;
            }

            rectX -= boxBorder;
            rectY -= boxBorder;
            rectW += boxBorder * 2f;
            rectH += boxBorder * 2f;

            #region glow
            if (csgo.GetValue <YesNo>("espGlowEnabled") == YesNo.Yes)
            {
                if (csgo.GlowObjects != null)
                {
                    CSGOGameController controller = (CSGOGameController)Program.GameController;
                    int idx = controller.MemoryUpdater.GetGlowObjectByAddress((int)entity.Address);
                    if (idx != -1)
                    {
                        GlowObjectDefinition def = csgo.GlowObjects[idx];
                        def.a = 1f;// (float)(brushColor.A / 255f);
                        def.r = (float)(brushColor.R / 255f);
                        def.g = (float)(brushColor.G / 255f);
                        def.b = (float)(brushColor.B / 255f);
                        def.m_bRenderWhenOccluded   = true;
                        def.m_bRenderWhenUnoccluded = true;
                        controller.MemoryUpdater.WriteGlowObject(def, idx);
                    }
                }
            }
            #endregion

            if (point != Vector2.Zero)
            {
                #region box
                if (csgo.GetValue <OnOff>("espDrawBox") == OnOff.On)
                {
                    //Draw box
                    DrawW2SBox(device,
                               brushColor,
                               entPoint - Vector3.UnitZ * 8,
                               16f,
                               16f,
                               entity.Yaw + 45f,
                               15f / distanceMeter);
                }
                #endregion

                #region distance
                if (csgo.GetValue <OnOff>("espDrawDistance") == OnOff.On)
                {
                    ////Draw text
                    DrawText(device,
                             foreColor,
                             backColor,
                             rectX,
                             rectY + rectH,
                             100f,
                             20f,
                             1f,
                             1f,
                             Math.Round(distanceMeter, 0).ToString() + "m",
                             FactoryManager.GetFont("smallSegoe"));
                }
                #endregion
                string name = entity.Name;
                if (
                    entity.ClassID != Data.Enums.ClassID.Chicken &&
                    entity.ClassID != Data.Enums.ClassID.Hostage &&
                    entity.ClassID != Data.Enums.ClassID.CSPlayer &&
                    entity.ClassID != Data.Enums.ClassID.Weapon &&
                    entity.ClassID != Data.Enums.ClassID.C4 &&
                    entity.ClassID != Data.Enums.ClassID.PlantedC4)
                {
                    name = String.Format("{0} (ID#{1})", name, entity.ClassID);
                }
                DrawText(device,
                         foreColor,
                         backColor,
                         rectX,
                         rectY - 20f,
                         100f,
                         20f,
                         1f,
                         1f,
                         name,
                         FactoryManager.GetFont("smallSegoe"));
            }
        }
Example #4
0
        public override void OnUpdaterTick()
        {
            if (Program.GameImplementation == null)
            {
                return;
            }
            if (Program.GameController == null)
            {
                return;
            }
            if (!Program.GameController.IsGameRunning)
            {
                return;
            }
            csgo = (CSGOImplementation)Program.GameImplementation;
            CSGOGameController controller = (CSGOGameController)Program.GameController;

            if (csgo == null)
            {
                return;
            }
            if (csgo.SignOnState != SignOnState.SIGNONSTATE_FULL)
            {
                return;
            }
            if (csgo.Players == null)
            {
                return;
            }
            if (csgo.LocalPlayer == null)
            {
                return;
            }
            if (csgo.LocalPlayer.Health <= 0)
            {
                return;
            }

            DoOtherStuff();

            if (csgo.GetValue <YesNo>("rcsEnabled") == YesNo.No)
            {
                return;
            }
            float force = csgo.GetValue <float>("rcsForce");

            if (lastPunch == csgo.LocalPlayer.PunchVector)
            {
                return;
            }
            if (csgo.LocalPlayer.PunchVector == Vector3.Zero)
            {
                return;
            }
            currentPunch = csgo.LocalPlayer.PunchVector - lastPunch;
            if (IsActive && currentPunch != Vector3.Zero)
            {
                Vector3 newViewAngles = csgo.ViewAngles - currentPunch * force;
                newViewAngles   = Geometry.ClampAngle(newViewAngles);
                newViewAngles.Z = 0f;
                controller.MemoryUpdater.WriteViewAngles(newViewAngles);
            }
            lastPunch = csgo.LocalPlayer.PunchVector;
        }
Example #5
0
        private void DrawPlayer(WindowRenderTarget device, Player currentPlayer, Player player)
        {
            if (player == null)
            {
                return;
            }
            if (player.Index == currentPlayer.Index)
            {
                return;
            }
            if (!player.IsValid())
            {
                return;
            }
            if (csgo.GetValue <Target>("espDrawTarget") == Target.Enemies && player.InTeam == currentPlayer.InTeam)
            {
                return;
            }
            if (csgo.GetValue <Target>("espDrawTarget") == Target.Allies && player.InTeam != currentPlayer.InTeam)
            {
                return;
            }

            player.CheckYaw();

            Vector2 point = Geometry.WorldToScreen(csgo.ViewMatrix, csgo.ScreenSize, (player.Vector3));

            if (point == Vector2.Zero)
            {
                return;
            }
            float distance    = Geometry.GetDistanceToPoint(currentPlayer.Vector3, player.Vector3);
            float height      = 36000f / distance;
            float width       = 18100f / distance;
            Color colorPlayer = player.InTeam == Team.Terrorists ?
                                (player.SeenBy(currentPlayer) ? colorTSpotted : colorT) :
                                (player.SeenBy(currentPlayer) ? colorCTSpotted : colorCT);

            float distanceMeter = currentPlayer.DistanceToOtherEntityInMetres(player);
            float head          = 3200f / distance;
            float boxBorder     = 6400f / distance;
            bool  highlighted   = csgo.Highlighted[player.Index - 1];
            //Paint bones
            List <Vector3> allBones = new List <Vector3>();

            allBones.AddRange(player.Skeleton.Legs);
            allBones.AddRange(player.Skeleton.Spine);
            allBones.Add(player.Skeleton.HeadEnd);

            Vector2[] all = Geometry.WorldToScreen(csgo.ViewMatrix, csgo.ScreenSize, allBones.ToArray());
            foreach (Vector2 vec in all)
            {
                if (vec == Vector2.Zero)
                {
                    return;
                }
            }
            Vector2[] arms  = Geometry.WorldToScreen(csgo.ViewMatrix, csgo.ScreenSize, player.Skeleton.Arms);
            Vector2[] legs  = Geometry.WorldToScreen(csgo.ViewMatrix, csgo.ScreenSize, player.Skeleton.Legs);
            Vector2[] spine = Geometry.WorldToScreen(csgo.ViewMatrix, csgo.ScreenSize, player.Skeleton.Spine);
            allBones.Clear();
            allBones = null;

            float rectX = GetSmallestX(all) + 5, rectW = GetBiggestX(all) + 5, rectY = GetSmallestY(all) + 5, rectH = GetBiggestY(all) + 5;

            //rectW -= rectX;
            rectH -= rectY;
            rectW  = rectH * 0.3f;
            rectX  = point.X - rectW / 2f;
            #region glow
            if (csgo.GetValue <YesNo>("espGlowEnabled") == YesNo.Yes)
            {
                if (csgo.GlowObjects != null)
                {
                    CSGOGameController controller = (CSGOGameController)Program.GameController;
                    int idx = controller.MemoryUpdater.GetGlowObjectByAddress((int)player.Address);
                    if (idx != -1)
                    {
                        GlowObjectDefinition def = csgo.GlowObjects[idx];
                        def.a = (float)(colorPlayer.A / 255f);
                        def.r = (float)(colorPlayer.R / 255f);
                        def.g = (float)(colorPlayer.G / 255f);
                        def.b = (float)(colorPlayer.B / 255f);
                        def.m_bRenderWhenOccluded   = true;
                        def.m_bRenderWhenUnoccluded = true;
                        def.m_bFullBloom            = false;
                        if (csgo.GetValue <YesNo>("espGlowFadingEnabled") == YesNo.Yes)
                        {
                            float dist  = currentPlayer.DistanceToOtherEntityInMetres(player);
                            float range = csgo.GetValue <float>("espGlowFadingDistance");
                            if (dist <= range)
                            {
                                def.a = 1f - 1f / range * dist;
                                controller.MemoryUpdater.WriteGlowObject(def, idx);
                            }
                        }
                        else
                        {
                            controller.MemoryUpdater.WriteGlowObject(def, idx);
                        }
                    }
                }
            }
            #endregion
            #region skeleton
            if (csgo.GetValue <OnOff>("espDrawSkeleton") == OnOff.On)
            {
                if (distanceMeter < 20)
                {
                    DrawBones(device,
                              colorPlayer,
                              arms,
                              1.5f,
                              player.InTeam
                              );
                }
                DrawBones(device,
                          colorPlayer,
                          legs,
                          1.5f,
                          player.InTeam
                          );
                DrawBones(device,
                          colorPlayer,
                          spine,
                          1.5f,
                          player.InTeam
                          );
            }
            if (player.Skeleton.AllBones != null)
            {
                for (int i = 0; i < player.Skeleton.AllBones.Length; i++)
                {
                    Vector2 boneHead = Geometry.WorldToScreen(csgo.ViewMatrix, csgo.ScreenSize, player.Skeleton.AllBones[i]);
                    DrawText(device,
                             foreColor,
                             backColor,
                             boneHead.X,
                             boneHead.Y,
                             100f,
                             20f,
                             1f,
                             1f,
                             i.ToString(),
                             FactoryManager.GetFont("largeSegoe"));
                }
            }
            #endregion
            #region lines
            if (csgo.GetValue <OnOff>("espDrawLines") == OnOff.On)
            {
                Color color = colorPlayer;
                if (!player.IsSpotted)
                {
                    color *= 0.5f;
                }
                else
                {
                    color *= (0.75f + 0.25f * GetColorMultiplier());
                }
                FillPolygon(device,
                            color,
                            new Vector2(csgo.ScreenSize.Width / 2f, csgo.ScreenSize.Height),
                            new Vector2(point.X - width / 2f, point.Y),
                            new Vector2(point.X + width / 2f, point.Y));
            }
            #endregion
            #region box
            //Draw box
            if (csgo.GetValue <OnOff>("espDrawBox") == OnOff.On)
            {
                this.DrawRectangle(device,
                                   colorPlayer,
                                   rectX,
                                   rectY,
                                   rectW,
                                   rectH,
                                   1f);
            }
            #endregion
            #region circle
            if (csgo.GetValue <OnOff>("espDrawCircle") == OnOff.On)
            {
                Vector3[] circPoints = Geometry.Create3DFlatCircle(
                    player.Vector3,
                    32f + (player.IsSpotted ? 16f * GetColorMultiplier() : 0f),
                    32);
                Vector2[] scrCircPoints = Geometry.WorldToScreen(csgo.ViewMatrix, csgo.ScreenSize, circPoints);
                DrawLines(device, colorPlayer, 15f / distanceMeter, scrCircPoints);
            }
            #endregion
            #region distance
            if (csgo.GetValue <OnOff>("espDrawDistance") == OnOff.On)
            {
                string     distString = Math.Round(distanceMeter, 0).ToString() + "m";
                RectangleF distSize   = Control.MeasureString(this.Font, distString);
                //Draw text
                DrawText(device,
                         foreColor,
                         backColor,
                         rectX + rectW / 2f - distSize.Width / 2f,
                         rectY + rectH,
                         100f,
                         20f,
                         1f,
                         1f,
                         distString,
                         FactoryManager.GetFont("smallSegoe"));
            }
            #endregion
            #region highlight
            if (highlighted)
            {
                float size  = (float)Math.Max(rectW + boxBorder, rectH + boxBorder) * 2f;
                Color color = (colorPlayer) * (0.5f + 0.5f * GetColorMultiplier());
                FillEllipse(
                    device,
                    color * 0.5f,
                    rectX + rectW / 2f,
                    rectY + rectH / 2f,
                    size,
                    size,
                    true);
                DrawEllipse(device,
                            color, //* (DateTime.Now.Millisecond % 1000f / 1000f),
                            rectX + rectW / 2f,
                            rectY + rectH / 2f,
                            size,
                            size,
                            true,
                            1.5f);
            }
            #endregion
            #region name
            if (csgo.GetValue <OnOff>("espDrawName") == OnOff.On)
            {
                ////Name
                //DrawText(device,
                //    foreColor,
                //    backColor,
                //    rectX + rectW,
                //    rectY - boxBorder,
                //    100f,
                //    20f,
                //    1f,
                //    1f,
                //    (player.IsDormant ? "[DORMANT] " : "") + player.Name,
                //    FactoryManager.GetFont("smallSegoe"));
                ////Info
                //string weaponInfo = "-";
                //if (player.WeaponIndex >= 0 && player.WeaponIndex < csgo.Entities.Length)
                //{
                //    if (csgo.Entities[player.WeaponIndex] != null)
                //        weaponInfo = csgo.Entities[player.WeaponIndex].Name;
                //}

                //string data = String.Format(
                //"Weapon: {0}",
                //    /*player.Health, player.Armor,*/ weaponInfo);

                //if (csgo.GetValue<OnOff>("espDrawDetails") == OnOff.On)
                //    data = String.Format("{0}\n" +
                //    "Balance: ${1}\n" +
                //    "Kills: {2}\n" +
                //    "Assists: {3}\n" +
                //    "Deaths: {4}\n" +
                //    "Score: {5}",
                //    data, player.Money, player.Kills, player.Assists, player.Deaths, player.Score);

                //DrawText(device,
                //    foreColor,
                //    backColor,
                //    rectX + rectW,
                //    rectY - boxBorder + 16f,
                //    100f,
                //    20f,
                //    1f,
                //    1f,
                //    data,
                //    FactoryManager.GetFont("tinySegoe"));
                string weaponInfo = "-";
                if (player.WeaponIndex >= 0 && player.WeaponIndex < csgo.Entities.Length)
                {
                    if (csgo.Entities[player.WeaponIndex] != null)
                    {
                        weaponInfo = csgo.Entities[player.WeaponIndex].Name;
                    }
                }
                string     str  = string.Format("{0}\n[{1}]", player.Name, weaponInfo);
                RectangleF size = Control.MeasureString(this.Font, str);
                //Name
                DrawText(device,
                         foreColor,
                         backColor,
                         rectX + rectW / 2f - size.Width / 2f,
                         rectY - 40,
                         100f,
                         20f,
                         2f,
                         2f,
                         str,
                         FactoryManager.GetFont("smallSegoe"));
            }
            #endregion
            #region health
            if (csgo.GetValue <OnOff>("espDrawHealth") == OnOff.On)
            {
                ////HP
                //FillRectangle(device,
                //        lifeBarBackground,
                //        rectX,
                //        rectY - lifeBarHeight * 3f,
                //        width, //rectW,
                //        lifeBarHeight /*10f*/);
                //FillRectangle(device,
                //        lifeBarForeground,
                //        rectX,
                //        rectY - lifeBarHeight * 3f,
                //    /*rectW*/ width / 100f * player.Health,
                //        lifeBarHeight /*10f*/);
                //DrawText(device,
                //    lifeBarForeground,
                //    backColor,
                //    rectX + width,
                //    rectY - lifeBarHeight * 3f - 2f,
                //    100f,
                //    20f,
                //    1f,
                //    1f,
                //    player.Health.ToString(),
                //    FactoryManager.GetFont("miniSegoe"));
                ////Armor
                //FillRectangle(device,
                //        lifeBarBackground,
                //        rectX,
                //        rectY - lifeBarHeight * 2f,
                //        width, //rectW,
                //        lifeBarHeight /*10f*/);
                //FillRectangle(device,
                //        viewColorOutline,
                //        rectX,
                //        rectY - lifeBarHeight * 2f,
                //    /*rectW*/ width / 100f * player.Armor,
                //        lifeBarHeight /*10f*/);
                //DrawText(device,
                //    viewColorOutline,
                //    backColor,
                //    rectX + width,
                //    rectY - lifeBarHeight * 2f - 2f,
                //    100f,
                //    20f,
                //    1f,
                //    1f,
                //    player.Armor.ToString(),
                //    FactoryManager.GetFont("miniSegoe"));
                //HP
                FillRectangle(device,
                              lifeBarBackground,
                              rectX - lifeBarWidth,
                              rectY,
                              lifeBarWidth, //rectW,
                              rectH /*10f*/);
                FillRectangle(device,
                              lifeBarForeground,
                              rectX - lifeBarWidth,
                              rectY,
                              lifeBarWidth,
                              rectH / 100f * player.Health /*10f*/);
                DrawText(device,
                         lifeBarForeground,
                         backColor,
                         rectX - lifeBarWidth,
                         rectY + rectH,
                         100f,
                         20f,
                         1f,
                         1f,
                         player.Health.ToString(),
                         FactoryManager.GetFont("miniSegoe"));
                //Armor
                FillRectangle(device,
                              lifeBarBackground,
                              rectX + rectW,
                              rectY,
                              lifeBarWidth, //rectW,
                              rectH /*10f*/);
                FillRectangle(device,
                              viewColorOutline,
                              rectX + rectW,
                              rectY,
                              lifeBarWidth,
                              rectH / 100f * player.Armor /*10f*/);
                DrawText(device,
                         viewColorOutline,
                         backColor,
                         rectX + rectW,
                         rectY + rectH,
                         100f,
                         20f,
                         1f,
                         1f,
                         player.Armor.ToString(),
                         FactoryManager.GetFont("miniSegoe"));
            }
            #endregion
            #region rank
            if (player.Rank > 0)
            {
                //Scaling
                float boxWidth = rectW, boxHeight = rectW * aspect;

                /*
                 * Args:
                 * 1 actual bitmap
                 * 2 destination-rectangle
                 * 3 opacity
                 * 4 interpolation mode
                 * 5 source-rectangle - easy access using rank as index
                 */
                if (ranksBmp != null)
                {
                    device.DrawBitmap(
                        ranksBmp,
                        new RectangleF(point.X - boxWidth / 2f, point.Y + 20f, boxWidth, boxHeight),
                        0.7f,
                        BitmapInterpolationMode.Linear,
                        new RectangleF(0f, 80f * (player.Rank - 1), 200f, 80f));
                    if (boxWidth > 50f)
                    {
                        DrawText(device, foreColor, point.X - boxWidth / 2f, point.Y + 20f + boxHeight + 4f, 200f, 100f, string.Format("MM-wins: {0}", player.Wins.ToString()), this.Font);
                    }
                }
            }
            #endregion
        }