public static void ApplyChams(ESPObj gameObject, Color vis, Color invis) { switch (gameObject.Options.ChamType) { case ShaderType.Flat: T.ApplyShader(Assets.Shaders["Chams"], gameObject.GObject, vis, invis); break; case ShaderType.Material: T.ApplyShader(Assets.Shaders["chamsLit"], gameObject.GObject, vis, invis); break; default: T.RemoveShaders(gameObject.GObject); break; } }
IEnumerator UpdateESPObjects() { // every 4 seconds refresh all world objects. DO NOT do this each frame while (true) { if (Provider.isConnected && G.MainCamera != null) { List <SteamPlayer> TempPlayers = new List <SteamPlayer>(); List <ESPObj> TempObjects = new List <ESPObj>(); #region Items if (G.Settings.ItemOptions.Enabled) { foreach (InteractableItem i in FindObjectsOfType <InteractableItem>()) { if (!T.IsItemWhitelisted(i, G.Settings.MiscOptions.ESPWhitelist)) { continue; } ESPObj obj = new ESPObj(ESPObject.Item, i, i.gameObject, G.Settings.ItemOptions); TempObjects.Add(obj); if (!G.BeingSpied) { ESP.ApplyChams(obj, Colors.GetColor("Item_Chams_Visible_Color"), Colors.GetColor("Item_Chams_Occluded_Color")); } } } #endregion #region Claimflags if (G.Settings.FlagOptions.Enabled) { foreach (InteractableClaim i in FindObjectsOfType <InteractableClaim>()) { ESPObj obj = new ESPObj(ESPObject.Flag, i, i.gameObject, G.Settings.FlagOptions); TempObjects.Add(obj); if (!G.BeingSpied) { ESP.ApplyChams(obj, Colors.GetColor("Flag_Chams_Visible_Color"), Colors.GetColor("Flag_Chams_Occluded_Color")); } } } #endregion #region Storages if (G.Settings.StorageOptions.Enabled) { foreach (InteractableStorage i in FindObjectsOfType <InteractableStorage>()) { ESPObj obj = new ESPObj(ESPObject.Storage, i, i.gameObject, G.Settings.StorageOptions); TempObjects.Add(obj); if (!G.BeingSpied) { ESP.ApplyChams(obj, Colors.GetColor("Storage_Chams_Visible_Color"), Colors.GetColor("Storage_Chams_Occluded_Color")); } } } #endregion #region Zombies if (G.Settings.ZombieOptions.Enabled) { foreach (Zombie i in FindObjectsOfType <Zombie>()) { ESPObj obj = new ESPObj(ESPObject.Zombie, i, i.gameObject, G.Settings.ZombieOptions); TempObjects.Add(obj); if (!G.BeingSpied) { ESP.ApplyChams(obj, Colors.GetColor("Zombie_Chams_Visible_Color"), Colors.GetColor("Zombie_Chams_Occluded_Color")); } } } #endregion #region Beds if (G.Settings.BedOptions.Enabled) { foreach (InteractableBed i in FindObjectsOfType <InteractableBed>()) { ESPObj obj = new ESPObj(ESPObject.Bed, i, i.gameObject, G.Settings.BedOptions); TempObjects.Add(obj); if (!G.BeingSpied) { ESP.ApplyChams(obj, Colors.GetColor("Bed_Chams_Visible_Color"), Colors.GetColor("Bed_Chams_Occluded_Color")); } } } #endregion #region Vehicles if (G.Settings.VehicleOptions.Enabled) { foreach (InteractableVehicle i in FindObjectsOfType <InteractableVehicle>()) { if (G.Settings.GlobalOptions.OnlyUnlocked && i.isLocked) { continue; } ESPObj obj = new ESPObj(ESPObject.Vehicle, i, i.gameObject, G.Settings.VehicleOptions); TempObjects.Add(obj); if (!G.BeingSpied) { ESP.ApplyChams(obj, Colors.GetColor("Vehicle_Chams_Visible_Color"), Colors.GetColor("Vehicle_Chams_Occluded_Color")); } } } #endregion #region Players foreach (SteamPlayer i in Provider.clients) { if (i != Player.player.channel.owner) { ESPObj obj = new ESPObj(ESPObject.Player, i, i.player.gameObject, G.Settings.PlayerOptions); TempObjects.Add(obj); Color oChams = Colors.GetColor("Player_Chams_Occluded_Color"); Color vChams = Colors.GetColor("Player_Chams_Visible_Color"); if (T.GetPriority(i.playerID.steamID.m_SteamID) == Priority.Friendly) { oChams = Colors.GetColor("Friendly_Chams_Occluded_Color"); vChams = Colors.GetColor("Friendly_Chams_Visible_Color"); } if (!G.BeingSpied) { ESP.ApplyChams(obj, vChams, oChams); } TempPlayers.Add(i); } } #endregion T.ConnectedPlayers = TempPlayers.ToArray(); ESP.EObjects = TempObjects; } yield return(new WaitForSeconds(4f)); } }
void OnGUI() { if (!Provider.isConnected || Provider.isLoading || (PlayerCam.IsFullScreen && PlayerCam.player != null)) { return; } #region Item Clump Boxes if (G.Settings.ItemOptions.Enabled && G.Settings.GlobalOptions.ListClumpedItems && !G.BeingSpied) { for (int i = 0; i < ItemClumps.Count; i++) { ItemClumpObject itemClumpObject = ItemClumps[i]; Vector3 pos = G.MainCamera.WorldToScreenPoint(itemClumpObject.WorldPos); pos.y = Screen.height - pos.y; if (pos.z >= 0 && (Vector3.Distance(Player.player.transform.position, itemClumpObject.WorldPos) <= G.Settings.ItemOptions.MaxDistance)) { string s = ""; foreach (InteractableItem item in itemClumpObject.ClumpedItems) { Color c1 = ItemTool.getRarityColorHighlight(item.asset.rarity); Color32 c = new Color32((byte)(c1.r * 255), (byte)(c1.g * 255), (byte)(c1.b * 255), 255); s += $"<color=#{Colors.ColorToHex(c)}>{item.asset.itemName}</color>\n"; } Vector2 TextHeight = GUIStyle.none.CalcSize(new GUIContent($"<size=10>{s}</size>")); GUILayout.BeginArea(new Rect(pos.x, pos.y, TextHeight.x + 10, TextHeight.y), style: "box"); GUILayout.Label($"<size=10>{s}</size>"); GUILayout.EndArea(); } } } GUI.skin = null; #endregion for (int i = 0; i < EObjects.Count; i++) { ESPObj obj = EObjects[i]; #region Checks if (obj.GObject != null && (!obj.Options.Enabled || T.GetDistance(obj.GObject.transform.position) > obj.Options.MaxDistance || (obj.Target == ESPObject.Item && (!T.IsItemWhitelisted((InteractableItem)obj.Object, G.Settings.MiscOptions.ESPWhitelist) || Items.IsAlreadyClumped((InteractableItem)obj.Object))))) { Highlighter h = obj.GObject.GetComponent <Highlighter>(); if (h != null) { h.ConstantOffImmediate(); } } if (obj.GObject == null || !T.InScreenView(G.MainCamera.WorldToViewportPoint(obj.GObject.transform.position)) || !obj.Options.Enabled || T.GetDistance(obj.GObject.transform.position) > obj.Options.MaxDistance) { continue; } if (G.BeingSpied) { Highlighter h = obj.GObject.GetComponent <Highlighter>(); if (h != null) { h.ConstantOffImmediate(); } T.RemoveShaders(obj.GObject); continue; } if (obj.Target == ESPObject.Player && ((SteamPlayer)obj.Object).player.life.isDead) { continue; } if (obj.Target == ESPObject.Zombie && ((Zombie)obj.Object).isDead) { continue; } if (obj.Target == ESPObject.Vehicle && ((InteractableVehicle)obj.Object).isDead) { continue; } if (obj.Target == ESPObject.Vehicle && G.Settings.GlobalOptions.OnlyUnlocked && ((InteractableVehicle)obj.Object).isLocked) { continue; } if (obj.Target == ESPObject.Bed && G.Settings.GlobalOptions.OnlyUnclaimed && ((InteractableBed)obj.Object).isClaimed) { continue; } if (obj.Target == ESPObject.Item && !T.IsItemWhitelisted((InteractableItem)obj.Object, G.Settings.MiscOptions.ESPWhitelist)) { continue; } if (obj.Target == ESPObject.Item && G.Settings.GlobalOptions.ListClumpedItems && Items.IsAlreadyClumped((InteractableItem)obj.Object)) { continue; } if (G.BeingSpied) { Highlighter h = obj.GObject.GetComponent <Highlighter>(); if (h != null) { h.ConstantOffImmediate(); } T.RemoveShaders(obj.GObject); continue; } #endregion #region Globals string LabelText = $"<size={obj.Options.FontSize}>"; string OutlineText = $"<size={obj.Options.FontSize}>"; Color32 color = Colors.GetColor(Enum.GetName(typeof(ESPObject), obj.Target) + "_ESP"); if (obj.Options.Distance) { LabelText += $"<color=white>[{T.GetDistance(obj.GObject.transform.position)}]</color> "; OutlineText += $"[{T.GetDistance(obj.GObject.transform.position)}] "; } #endregion #region Label Shit switch (obj.Target) { case ESPObject.Player: Player player = ((SteamPlayer)obj.Object).player; switch (T.GetPriority(((SteamPlayer)obj.Object).playerID.steamID.m_SteamID)) { case Priority.Friendly: color = Colors.GetColor("Friendly_Player_ESP"); break; case Priority.Marked: color = Colors.GetColor("Marked_Player_ESP"); break; } if (obj.Options.Name) { LabelText += ((SteamPlayer)obj.Object).playerID.characterName; OutlineText += ((SteamPlayer)obj.Object).playerID.characterName; } if (G.Settings.GlobalOptions.Weapon) { string Weapon = player.equipment.asset != null ? ((SteamPlayer)obj.Object).player.equipment.asset.itemName : "None"; LabelText += $"<color=white> - {Weapon}</color>"; OutlineText += " - " + Weapon; } if (G.Settings.GlobalOptions.ViewHitboxes && G.Settings.AimbotOptions.ExpandHitboxes && G.Settings.AimbotOptions.SilentAim) { Player p = ((SteamPlayer)obj.Object).player; Vector3 W2SPlayer = T.WorldToScreen(player.transform.position); if (W2SPlayer.z >= 0) { Vector3 W2SOffset = T.WorldToScreen(new Vector3(player.transform.position.x, player.transform.position.y + G.Settings.AimbotOptions.HitboxSize, player.transform.position.z)); float Distance = Vector3.Distance(W2SPlayer, W2SOffset); T.DrawCircle(Colors.GetColor("Extended_Hitbox_Circle"), new Vector2(W2SPlayer.x, W2SPlayer.y), Distance); } } break; case ESPObject.Item: if (obj.Options.Name) { LabelText += ((InteractableItem)obj.Object).asset.itemName; OutlineText += ((InteractableItem)obj.Object).asset.itemName; } break; case ESPObject.Vehicle: if (obj.Options.Name) { LabelText += ((InteractableVehicle)obj.Object).asset.vehicleName; OutlineText += ((InteractableVehicle)obj.Object).asset.vehicleName; } if (G.Settings.GlobalOptions.VehicleLocked) { if (((InteractableVehicle)obj.Object).isLocked) { LabelText += $"<color=white> - Locked</color>"; OutlineText += " - Locked"; } else { LabelText += $"<color=white> - </color><color=ff5a00>Unlocked</color>"; OutlineText += " - Unlocked"; } } break; case ESPObject.Bed: if (obj.Options.Name) { LabelText += Enum.GetName(typeof(ESPObject), obj.Target); OutlineText += Enum.GetName(typeof(ESPObject), obj.Target); } if (G.Settings.GlobalOptions.Claimed) { if (((InteractableBed)obj.Object).isClaimed) { LabelText += $"<color=white> - Claimed</color>"; OutlineText += " - Claimed"; } else { LabelText += $"<color=white> - </color><color=ff5a00>Unclaimed</color>"; OutlineText += " - Unclaimed"; } } break; case ESPObject.Storage: BarricadeData bdata = null; if (obj.Options.Name || G.Settings.GlobalOptions.ShowLocked) { try { BarricadeRegion r; if (BarricadeManager.tryGetInfo(((InteractableStorage)obj.Object).transform, out byte x, out byte y, out ushort plant, out ushort index, out r)) { bdata = r.barricades[index]; } } catch (Exception ex) { Debug.Log(ex); } } if (obj.Options.Name) { string s = "Storage"; if (bdata != null) { s = bdata.barricade.asset.name.Replace("_", " "); } LabelText += s; OutlineText += s; } if (G.Settings.GlobalOptions.ShowLocked) { if (bdata != null) { if (bdata.barricade.asset.isLocked) { LabelText += $"<color=white> - Locked</color>"; OutlineText += " - Locked"; } else { LabelText += $"<color=white> - </color><color=ff5a00>Unlocked</color>"; OutlineText += " - Unlocked"; } } else { LabelText += $"<color=white> - Unknown</color>"; OutlineText += " - Unknown"; } } break; default: if (obj.Options.Name) { LabelText += Enum.GetName(typeof(ESPObject), obj.Target); OutlineText += Enum.GetName(typeof(ESPObject), obj.Target); } break; } #endregion #region Draw LabelText += "</size>"; OutlineText += "</size>"; if (obj.Options.Tracers) { T.DrawSnapline(obj.GObject.transform.position, color); } if (!String.IsNullOrEmpty(LabelText)) { T.DrawESPLabel(obj.GObject.transform.position, color, Color.black, LabelText, OutlineText); } if (obj.Options.Box) { if (obj.Target == ESPObject.Player) { Vector3 p = obj.GObject.transform.position; Vector3 s = obj.GObject.transform.localScale; if (p != null & s != null) { T.Draw3DBox(new Bounds(p + new Vector3(0, 1.1f, 0), s + new Vector3(0, .95f, 0)), color); } } else { T.Draw3DBox(obj.GObject.GetComponent <Collider>().bounds, color); } } if (obj.Options.Glow) { Highlighter h = obj.GObject.GetComponent <Highlighter>() ?? obj.GObject.AddComponent <Highlighter>(); h.occluder = true; h.overlay = true; h.ConstantOnImmediate(color); } else { Highlighter h = obj.GObject.GetComponent <Highlighter>(); if (h != null) { h.ConstantOffImmediate(); } } #endregion } // sometimes shows localplayer glowing after your car explodes Highlighter hi = Player.player?.gameObject?.GetComponent <Highlighter>(); if (hi != null) { hi.ConstantOffImmediate(); } }