예제 #1
0
        private static void DrawBlip(GameOverlay.Drawing.Graphics gfx, FlatSDKInternal.Entity go)
        {
            FlatSDK.WorldToScreen(FlatSDK.Overlay.Width, FlatSDK.Overlay.Height, go.extra.FootPos, out Vector2 MaxOutput);
            bool   w2s          = FlatSDK.WorldToScreen(FlatSDK.Overlay.Width, FlatSDK.Overlay.Height, go.position, out Vector2 MinOutput);
            var    distance     = (go.position - LocalPlayer.position).Length() / 100;
            var    fark2        = (go.extra.FootPos - go.position).Length() / 100;
            var    fark         = MinOutput.Y - MaxOutput.Y;
            string state        = string.Empty;
            var    FontSize     = Math.Max(10, Math.Min(fark, 16.0f));
            string HealthDSTR   = ESPOptions.bShowHealth == 1 ? Math.Round(go.extra.health) + "hp" : string.Empty;
            string DistanceDSTR = ESPOptions.bShowDistance == 1? Math.Round(distance) + "mt" : string.Empty;

            if (ESPOptions.bShowState == 1)
            {
                if (fark2 > 3)
                {
                    state = "| Driving |" + Environment.NewLine;
                }
                else if (fark2 > 0.88f && fark2 < 3)
                {
                    state = "| Running |" + Environment.NewLine;
                }

                else if (fark2 < 0.5f && fark2 < 3)
                {
                    state = "| Snake |" + Environment.NewLine;
                }
                else if (fark2 == 0.6f)
                {
                    state = "| Crouch |" + Environment.NewLine;
                }
                else if (fark2 == 0.88f)
                {
                    state = "| Stand |" + Environment.NewLine;
                }
            }


            if (w2s)
            {
                var topx = FlatSDK.Overlay.Width / 2;
                var topy = 0;

                if (ESPOptions.bSnapLines == 1)
                {
                    if (fark2 > 3)
                    {
                        gfx.DrawLine(FlatSDKInternal.IRenderer._opakwhite, topx, topy, MinOutput.X, MinOutput.Y, 1);
                    }
                    else
                    {
                        gfx.DrawLine(FlatSDKInternal.IRenderer._opakwhite, topx, topy, MinOutput.X, MinOutput.Y - fark * 2.2f, 1);
                    }
                }

                // 2DBOX
                if (ESPOptions.bShowBox == 1)
                {
                    if (fark2 > 3)
                    {
                        gfx.OutlineRectangle(FlatSDKInternal.IRenderer._black, FlatSDKInternal.IRenderer._blue, Rectangle.Create(MinOutput.X, MinOutput.Y, 5, 5), 2);
                    }
                    else
                    {
                        gfx.OutlineRectangle(FlatSDKInternal.IRenderer._black, FlatSDKInternal.IRenderer._blue, Rectangle.Create(MinOutput.X - (fark / 2), MinOutput.Y - fark * 2.2f, fark, fark * 2.2f), 2);
                    }
                }


                // TEXT
                if (ESPOptions.bShowState == 1 || ESPOptions.bShowDistance == 1 || ESPOptions.bShowHealth == 1)
                {
                    gfx.DrawText(FlatSDKInternal.IRenderer._font, FontSize, FlatSDKInternal.IRenderer._white, MinOutput.X - FontSize - 10, MinOutput.Y, $"{DistanceDSTR} {HealthDSTR} {Environment.NewLine + state} ");
                }
            }
        }
예제 #2
0
        private static void FlatSDK_DrawGraphics(object sender, DrawGraphicsEventArgs e)
        {
            var gfx = e.Graphics;

            if (AimOptions.bSaveBTN == 1)
            {
                SerializeStatic.Serialize(typeof(AimOptions), "AimCFG.xml");
                AimOptions.bSaveBTN = 0;
            }
            if (AimOptions.bLoadBTN == 1)
            {
                SerializeStatic.Deserialize(typeof(AimOptions), "AimCFG.xml");
                AimOptions.bLoadBTN = 0;
            }

            LocalPlayer = FlatSDK.GetLocalPlayer();

            if (LocalPlayer == null)
            {
                return;
            }
            if (LocalPlayer.extra == null)
            {
                return;
            }

            var entList = GetEntitiesAsArray();

            var AimTargets = new AimTarget[entList.Length];

            float fClosestDist = -1;

            float ScreenCenterX = FlatSDK.Overlay.Width / 2.0f;
            float ScreenCenterY = FlatSDK.Overlay.Height / 2.0f;


            if (AimOptions.bDrawFow == 1)
            {
                gfx.DrawCircle(FlatSDKInternal.IRenderer._opakwhite, ScreenCenterX, ScreenCenterY, AimOptions.bFovArray[AimOptions.bFovInt], 2);
            }



            for (int i = 0; i < entList.Length; i++)
            {
                var current = entList[i];
                if (current.type != 82)
                {
                    continue;
                }


                var clampPos = current.HeadBone.position - current.position;


                bool w2sHead = FlatSDK.WorldToScreen(FlatSDK.Overlay.Width, FlatSDK.Overlay.Height, new Vector3(current.HeadBone.position.X, current.HeadBone.position.Y - (AimOptions.bPredict * 2), current.HeadBone.position.Z - (AimOptions.bYAxis * 8)), out Vector2 HeadPosition);
                AimTargets[i]                   = new AimTarget();
                AimTargets[i].Screen2D          = HeadPosition;
                AimTargets[i].uniqueID          = current.uniqueID;
                AimTargets[i].CrosshairDistance = Vector2.Distance(HeadPosition, new Vector2(ScreenCenterX, ScreenCenterY));



                // isInFov
                if (BestTargetUniqID == -1)
                {
                    if (isInside(ScreenCenterX, ScreenCenterY, AimOptions.bFovArray[AimOptions.bFovInt], AimTargets[i].Screen2D.X, AimTargets[i].Screen2D.Y))
                    {
                        fClosestDist     = AimTargets[i].CrosshairDistance;
                        BestTargetUniqID = AimTargets[i].uniqueID;
                    }
                }

                //if (BestTargetUniqID == -1)
                //{
                //    if (w2sHead)
                //    {
                //        gfx.FillCircle(FlatSDKInternal.IRenderer._opakwhite, HeadPosition.X, HeadPosition.Y, 5);
                //    }
                //}
                //else
                //{
                //    if (w2sHead)
                //    {
                //        gfx.FillCircle(FlatSDKInternal.IRenderer._red, HeadPosition.X, HeadPosition.Y, 5);
                //    }
                //}
            }


            if (FlatSDK.IsKeyPushedDown(AimOptions.bAimKeys[AimOptions.bAimKeyINT]))
            {
                if (BestTargetUniqID != -1)
                {
                    var best = FindAimTargetByUniqueID(AimTargets, BestTargetUniqID);

                    if (best != null)
                    {
                        // kek

                        {
                            var roundPos = new Vector2((float)Math.Round(best.Screen2D.X), (float)Math.Round(best.Screen2D.Y));
                            AimAtPosV2(roundPos.X, roundPos.Y, false);
                        }
                    }
                }
            }
            else
            {
                BestTargetUniqID = -1;
            }
        }
예제 #3
0
        private void DrawItemWeapon(GameOverlay.Drawing.Graphics gfx, FlatSDKInternal.Entity go, string itemId)
        {
            FlatSDK.WorldToScreen(FlatSDK.Overlay.Width, FlatSDK.Overlay.Height, go.extra.FootPos, out Vector2 MaxOutput);
            bool w2s = FlatSDK.WorldToScreen(FlatSDK.Overlay.Width, FlatSDK.Overlay.Height, go.position, out Vector2 MinOutput);

            float x = MinOutput.X - lootItems[itemId].fontSize - 10;
            float y = MinOutput.Y;

            if (ESPXOptions.bFixOverview == 1)
            {
                y = findFreeAreaForDraw(x, y, x + lootItems[itemId].textWidth + 8f, y + lootItems[itemId].fontSize + 8f);
            }

            float padding = 0f;

            if (ESPXOptions.bTextWithBg == 1)
            {
                padding = 8f;
            }

            float r = x + lootItems[itemId].textWidth + padding;
            float b = y + lootItems[itemId].fontSize + padding;


            if (ESPXOptions.bLockInScreen == 1)
            {
                if (x < 0)
                {
                    x = 0;
                }
                if (y < 0)
                {
                    y = 0;
                }
                if (r > FlatSDK.Overlay.Width)
                {
                    x = FlatSDK.Overlay.Width + x - r;
                }
                if (b > FlatSDK.Overlay.Height)
                {
                    y = FlatSDK.Overlay.Height + y - b;
                }
            }

            try {
                if (ESPXOptions.bShowAllItems == 1 || lootItems[itemId].view)
                {
                    if (ESPXOptions.bTextWithBg == 1)
                    {
                        gfx.DrawTextWithBackground(FlatSDKInternal.IRenderer._font, lootItems[itemId].fontSize, lootItems[itemId].fontBrush, lootItems[itemId].bgBrush, x, y, lootItems[itemId].name.ToString());
                    }
                    else
                    {
                        gfx.DrawText(FlatSDKInternal.IRenderer._font, lootItems[itemId].fontSize, lootItems[itemId].fontBrush, x, y, lootItems[itemId].name.ToString());
                    }
                }
                if (ESPXOptions.bFixOverview == 1)
                {
                    entityDrawPositions.Add(new float[] { x, y, r, b });
                }
            }  catch { }
        }