Пример #1
0
        private void DrawPickups()
        {
            foreach (Pickup pickup in ItemManager.Pickups)
            {
                if (!ItemManager.IsValidPickup(pickup))
                {
                    continue;
                }

                float distance = Mathf.Floor(PlayerManager.DistanceTo(pickup.transform));
                if (distance > HackSettings.GetFloat("ESP_Item_Distance"))
                {
                    continue;
                }

                var W2S = Camera.main.WorldToScreenPoint(pickup.transform.position);
                if (W2S.z < 0.01f)
                {
                    continue;
                }

                Color drawColor       = ItemManager.GetItemTypeColor(pickup.weaponType);
                var   drawText        = $"{pickup.itemName}";
                var   drawSize        = GUI.skin.GetStyle(drawText).CalcSize(new GUIContent(drawText));
                float customESPHeight = 5 / distance * 34;
                W2S += new Vector3(customESPHeight - customESPHeight * 1.35f, customESPHeight, 0);
                if (HackSettings.GetState("ESP_Item_Draw_Name"))
                {
                    GuIDraw.DrawShadow(new Rect(W2S.x - drawSize.x / 2, (float)Screen.height - W2S.y, drawSize.x, drawSize.y), new GUIContent(drawText), GUI.skin.GetStyle(""), drawColor, Color.black, Vector2.zero);
                }

                /*
                 *  ToDo: Fix 2DBox size
                 */
                if (HackSettings.GetState("ESP_Item_Draw_2DBox"))
                {
                    GuIDraw.Draw2DBox(W2S.x, Screen.height - W2S.y, 20, 20, drawColor);
                }
                //GuIDraw.Draw3DBox(pickup.gameObject, drawColor); //Works and doesn't work at the same time

                bool shouldIGlow = HackSettings.GetState("ESP_Item_Draw_Glow");
                pickup.gameObject.MakeMeGlow(drawColor, shouldIGlow);
            }
        }
Пример #2
0
        private void DrawVehicles()
        {
            foreach (Car car in CarManager.Cars)
            {
                float distance = Mathf.Floor(PlayerManager.DistanceTo(car.transform));
                if (distance > HackSettings.GetFloat("ESP_Vehicle_Distance"))
                {
                    continue;
                }

                var W2S = Camera.main.WorldToScreenPoint(car.transform.position);
                if (W2S.z < 0.01f)
                {
                    continue;
                }
                float customESPHeight = 25 / distance * 34;
                W2S += new Vector3(customESPHeight - customESPHeight * 1.35f, customESPHeight, 0);
                Color drawColor = Color.blue;
                var   drawText  = (HackSettings.GetState("ESP_Vehicle_Draw_Distance") ? $"({distance})" : "") + (HackSettings.GetState("ESP_Vehicle_Draw_Name") ? $"{car.name}" : "");
                var   drawSize  = GUI.skin.GetStyle(drawText).CalcSize(new GUIContent(drawText));

                if (HackSettings.GetState("ESP_Vehicle_Draw_Name"))
                {
                    GuIDraw.DrawShadow(new Rect(W2S.x - drawSize.x / 2, (float)Screen.height - W2S.y, drawSize.x, drawSize.y), new GUIContent(drawText), GUI.skin.GetStyle(""), drawColor, Color.black, Vector2.zero);
                }

                /*
                 *  ToDo: Fix 2DBox size
                 */
                if (HackSettings.GetState("ESP_Vehicle_Draw_2DBox"))
                {
                    GuIDraw.Draw2DBox(W2S.x - 70f, Screen.height - W2S.y, 50, 70, drawColor);
                }
                bool shouldIGlow = HackSettings.GetState("ESP_Vehicle_Draw_Glow");
                car.gameObject.MakeMeGlow(drawColor, shouldIGlow);
                //GuIDraw.Draw3DBox(car.gameObject, drawColor);
            }
        }
Пример #3
0
        private void DrawPlayers()
        {
            foreach (Player player in PlayerManager.Players)
            {
                if (!player.IsPlayerValid(HackSettings.GetState("PM_IgnoreTeam"), true))
                {
                    continue;
                }
                if (HackSettings.GetState("PM_IgnoreDummies") && player.IsDummy())
                {
                    continue;
                }
                Torso m_torso       = player.m_torso;
                float distanceToObj = Mathf.Floor(PlayerManager.DistanceTo(m_torso.transform));
                if (distanceToObj > HackSettings.GetFloat("ESP_Player_Distance"))
                {
                    continue;
                }
                var W2S = Camera.main.WorldToScreenPoint(m_torso.transform.position);
                if (W2S.z < 0.01f)
                {
                    continue;
                }

                int   healthRnd       = (int)Math.Floor(player.m_playerDeath.health);
                float customESPHeight = 25 / distanceToObj * 34;
                W2S += new Vector3(customESPHeight - customESPHeight * 1.35f, customESPHeight, 0);
                Color drawColor = HackSettings.GetColor("ESP_Player_Color_General");
                if (HackSettings.GetState("ESP_Player_Draw_Nearest"))
                {
                    if (PlayerManager.NearestPlayer == player)
                    {
                        drawColor = HackSettings.GetColor("ESP_Player_Color_Nearest");
                    }
                }
                string drawText = (HackSettings.GetState("ESP_Player_Draw_Name") ? $"{PlayerManager.GetName(player)}" : "") +
                                  (HackSettings.GetState("ESP_Player_Draw_Distance") ? $"({distanceToObj})" : "") +
                                  (HackSettings.GetState("ESP_Player_Draw_Health") ? $"\n{healthRnd} HP" : "");
                Vector2 drawSize = GUI.skin.GetStyle(drawText).CalcSize(new GUIContent(drawText));

                /*
                 *  ToDo: Fix 2DBox size
                 */
                if (HackSettings.GetState("ESP_Player_Draw_2DBox"))
                {
                    GuIDraw.Draw2DBox(W2S.x, (float)Screen.height - W2S.y, 30f, 60f, Color.blue);
                }

                GuIDraw.DrawShadow(new Rect(W2S.x - drawSize.x / 2, (float)Screen.height - W2S.y, drawSize.x, drawSize.y), new GUIContent(drawText), GUI.skin.GetStyle(""), drawColor, Color.black, Vector2.zero);
                if (HackSettings.GetState("ESP_Player_Draw_HeadX"))
                {
                    Vector3 headW2S = Camera.main.WorldToScreenPoint(player.m_head.transform.position);
                    if (headW2S.z > 0.01f)
                    {
                        GuIDraw.DrawShadow(new Rect(headW2S.x, (float)Screen.height - headW2S.y, 40, 40), new GUIContent("X"), GUI.skin.GetStyle(""), drawColor, Color.black, Vector2.zero);
                    }
                }
                bool shouldIGlow = HackSettings.GetState("ESP_Player_Draw_Glow");
                player.gameObject.MakeMeGlow(drawColor, shouldIGlow);
            }
        }