void Start() { glowManager = GetComponent <GlowManager>(); tile = GetComponentInParent <Tile>(); pathOnClick = GetComponent <PathOnClick>(); }
protected override void OnUpdate(TickEventArgs args) { base.OnUpdate(args); glowManager = Program.Hack.Memory.Read <GlowManager>(Program.Hack.ClientDll.BaseAddress.ToInt32() + Program.Offsets.GlowManager); if (glowManager.m_pGlowArray == 0 || glowManager.m_iNumObjects == 0) { return; } var lp = Program.Hack.StateMod.LocalPlayer.Value; Array = new RPMLazyArray <GlowObjectDefinition>(glowManager.m_pGlowArray, glowManager.m_iNumObjects); for (int i = 0; i < glowManager.m_iNumObjects; i++) { var obj = Array[i]; var proto = Program.Hack.GetEntityByAddress <EntityPrototype>(obj.pEntity); if (proto == null || !proto.IsValid) { continue; } BaseCombatWeapon wep = null; CSPlayer player = null; if (BaseCombatWeapon.IsWeapon(proto)) { wep = Program.Hack.GetEntityByAddress <BaseCombatWeapon>(obj.pEntity); } if (CSPlayer.IsPlayer(proto)) { player = Program.Hack.GetEntityByAddress <CSPlayer>(obj.pEntity); } if (wep != null && wep.IsValid) { if (Program.CurrentSettings.Glow.C4.Enabled && wep.IsC4) { EncolorObject(obj, Program.CurrentSettings.Glow.C4.Color, i); } else if (Program.CurrentSettings.Glow.Grenades.Enabled && wep.IsGrenadeProjectile) { EncolorObject(obj, Program.CurrentSettings.Glow.Grenades.Color, i); } else if (Program.CurrentSettings.Glow.Weapons.Enabled) { EncolorObject(obj, Program.CurrentSettings.Glow.Weapons.Color, i); } Program.Hack.StateMod.Weapons[wep.m_iID] = wep; } else if (player != null && player.IsValid) { if (lp == null || !lp.IsValid || ((Heke)Hack).AimBot.CurrentTarget == player.m_iID) { continue; } bool friend = lp.m_iTeamNum == player.m_iTeamNum; if (Program.CurrentSettings.Glow.Allies.Enabled && friend) { EncolorObject(obj, Program.CurrentSettings.Glow.Allies.Color, i); } if (Program.CurrentSettings.Glow.Enemies.Enabled && !friend) { EncolorObject(obj, Program.CurrentSettings.Glow.Enemies.Color, i); } } else { if (proto.m_ClientClass.NetworkName.Value == "CChicken") { EncolorObject(obj, Color.Orange, i); } var baseEnt = Program.Hack.GetEntityByAddress <BaseEntity>(proto.Address); } } }