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); } }