protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            var display = OptionName;

            if (Gun != default)
            {
                var csPlayer    = CSPlayer.Get();
                var playerMoney = csPlayer.Money;

                if (playerMoney < Gun.Price)
                {
                    display += $" ({playerMoney} / {Gun.Price} $)";
                }

                csPlayer.GetAmmoCost(Gun, out var buyable, out var cost);

                if (cost > 0)
                {
                    display += $" (r: {(int)Math.Ceiling(cost)} for {buyable})";
                }
            }


            DrawBorderedRectangle(this.GetDimensions().Position(), (int)this.Width.Pixels, (int)this.Height.Pixels, IsMouseHovering ? Color.Red * 0.5f : Color.Black * 0.5f, Color.Orange, spriteBatch);
            spriteBatch.DrawString(Main.fontMouseText, display, this.GetDimensions().Position() + new Vector2(6, this.Height.Pixels - 28), Color.Orange);

            var mousePosition = new Vector2((float)Main.mouseX, (float)Main.mouseY);

            if (this.ContainsPoint(mousePosition))
            {
                Main.LocalPlayer.mouseInterface = true;
            }
        }
예제 #2
0
    public static void AddPlayer(CSPlayer csplayer)
    {
        Player player = Player.CreatePlayer(csplayer);

        player.transform.parent = instance.transform;
        playerDict.Add(csplayer.PlayerID, player);
    }
        protected override void ActionLocal(CommandCaller caller, Player player, string input, string[] args)
        {
            CSPlayer csPlayer = CSPlayer.Get(player);

            if (args.Length == 0)
            {
                Main.NewTextMultiline(Usage, c: Color.Red);
                return;
            }

            args[0] = args[0].ToLower();

            if (args[0].Equals("-a"))
            {
                List <string> ammo = new List <string>();

                foreach (GunDefinition gun in csPlayer.OwnedAmmo())
                {
                    ammo.Add($"{gun.UnlocalizedName}:{csPlayer.GetAmmo(gun)}");
                }
            }
            else
            {
                GunDefinition definition = GunDefinitions.Instance.FindGeneric(g => g.UnlocalizedName.Equals(args[0], StringComparison.CurrentCultureIgnoreCase));

                if (definition == default)
                {
                    Main.NewText($"Specified gun `{args[0]}` doesn't exist.", Color.Red);
                    return;
                }

                Main.NewText($"{definition.UnlocalizedName}:{csPlayer.GetAmmo(definition)}");
            }
        }
        protected override void ActionLocal(CommandCaller caller, Player player, string input, string[] args)
        {
            if (args.Length == 0)
            {
                Main.NewText(Usage, Color.Red);
                return;
            }


            GunDefinition definition = GunDefinitions.Instance.FindGeneric(g => g.UnlocalizedName.Equals(args[0], StringComparison.CurrentCultureIgnoreCase));

            if (definition == default)
            {
                Main.NewText($"Gun name '{args[0]} is invalid. Use /cs_guns for a list of guns.");
                return;
            }


            CSPlayer csPlayer = CSPlayer.Get(player);

            if (csPlayer.Money < definition.Price)
            {
                Main.NewText($"Specified gun '{args[0]}' is too costly. Use /cs_guns -a for a list of guns you can buy.");
                return;
            }


            csPlayer.TryBuyGun(definition);
        }
예제 #5
0
        public static void SetPlayerData(uint playerID, CSPlayer playerData)
        {
            MemoryStream valueStream = new MemoryStream();

            ProtoBuf.Serializer.Serialize(valueStream, playerData);

            database.HashSet(KEY_PLAYER_DICT, playerID, valueStream.ToArray());
        }
예제 #6
0
        protected override void ActionLocal(CommandCaller caller, Player player, string input, string[] args)
        {
            CSPlayer csPlayer = CSPlayer.Get(player);

            Color textColor = csPlayer.Money > 0 ? Color.Green : csPlayer.Money == 0 ? Color.White : Color.Red;

            Main.NewText("Current money: " + csPlayer.Money, textColor);
        }
        public override void NPCLoot(NPC npc)
        {
            if (npc.lastInteraction == 255)
            {
                return;
            }

            CSPlayer.Get(npc.lastInteraction).OnKillNPC(npc);
        }
예제 #8
0
        public override void HoldItem(Player player)
        {
            CSPlayer csPlayer = CSPlayer.Get(player);

            if (Definition.CanBeMounted && csPlayer.GunMounted)
            {
                player.maxRunSpeed = 0;
                player.velocity    = Vector2.Zero;
            }
        }
예제 #9
0
    public static Player CreatePlayer(CSPlayer p)
    {
        GameObject prefab = Resources.Load <GameObject>("Prefabs/OtherPlayer");
        GameObject go     = Instantiate(prefab);
        Player     player = go.AddComponent <Player>();

        player.id         = p.PlayerID;
        player.playerName = p.Name;
        player.position   = p.Position.ToVector3();
        player.rotation   = p.Rotation.ToVector3();
        return(player);
    }
예제 #10
0
 public static bool GetPlayerData(uint playerID, out CSPlayer playerData)
 {
     byte[] data = database.HashGet(KEY_PLAYER_DICT, playerID);
     if (data != null)
     {
         MemoryStream valueStream = new MemoryStream(data);
         playerData = ProtoBuf.Serializer.Deserialize <CSPlayer>(valueStream);
         return(true);
     }
     else
     {
         playerData = null;
         return(false);
     }
 }
예제 #11
0
 private void RefreshPlayerHealthUI(CSPlayer player)
 {
     if (player == null)
     {
         return;
     }
     if (configData.EventSettings.ShowHeliHealthUI)
     {
         foreach (var heli in CSHelicopters)
         {
             player.DestroyUi(heli.heliId);
             player.AddUi(CreateHealthIndicator(heli, CSHelicopters.IndexOf(heli)), heli.heliId);
         }
     }
 }
        protected override void ActionLocal(CommandCaller caller, Player player, string input, string[] args)
        {
            CSPlayer csPlayer = CSPlayer.Get(player);

            if (args.Length == 0)
            {
                return;
            }

            if (!int.TryParse(args[0], out int money))
            {
                return;
            }

            csPlayer.ModifyMoney(money);
        }
예제 #13
0
        public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
        {
            CSPlayer csPlayer = CSPlayer.Get(player);

            Vector2 unaccurateSpeed = new Vector2(speedX, speedY).RotatedByRandom(
                (1 - csPlayer.AccuracyFactor) * MathHelper.ToRadians((1 - Definition.GetAccuracy(csPlayer)) * Constants.MAX_SPREAD));

            speedX = unaccurateSpeed.X;
            speedY = unaccurateSpeed.Y;

            csPlayer.AccuracyFactor += Definition.GetAccuracyChangePerShot(csPlayer);

            csPlayer.ConsumeAmmo(Definition, 1);

            return(true);
        }
예제 #14
0
        public override bool CanUseItem(Player player)
        {
            CSPlayer csPlayer = CSPlayer.Get(player);

            if (player.altFunctionUse == ItemAlternativeFunctionID.ActivatedAndUsed)
            {
                if (Main.mouseRightRelease)
                {
                    csPlayer.ToggleMount();
                    CombatText.NewText(new Rectangle((int)player.Center.X, (int)player.Center.Y, 0, 0), Color.Red, csPlayer.GunMounted ? "Mounted" : "Dismounted");
                }

                return(false);
            }

            return(csPlayer.HasAmmo(Definition) && !csPlayer.Reloading);
        }
예제 #15
0
 static void AddPlayer(Player player, CSPlayer playerData)
 {
     player.id       = playerData.PlayerID;
     player.name     = playerData.Name;
     player.position = new Vector3 {
         x = playerData.Position.x, y = playerData.Position.y, z = playerData.Position.z
     };
     player.rotation = new Vector3 {
         x = playerData.Rotation.x, y = playerData.Rotation.y, z = playerData.Rotation.z
     };
     player.inRoom   = true;
     player.curChunk = new Vector2Int {
         x = (int)Math.Floor(player.position.x / 16f), y = (int)Math.Floor(player.position.z / 16f)
     };
     TerrainData.GetChunkPlayers(player.curChunk).Add(player);
     players.Add(player.id, player);
     Ultilities.Print($"player {player.name}({player.socket.RemoteEndPoint}) has logged in!");
 }
예제 #16
0
        public static void UpdateThread()
        {
            var tempEntList    = new List <CSPlayer>();
            var tempTargetList = new List <CSPlayer>();

            new Thread(() =>
            {
                while (true)
                {
                    if (G.GlobalOffensive.HasExited)
                    {
                        H.SafeExit();
                    }

                    G.LocalPlayer = new CSPlayer(G.ClientBase + Offsets.m_dwLocalPlayer);

                    tempEntList.Clear();
                    tempTargetList.Clear();

                    for (int x = 1; x <= 64; x++)
                    {
                        CSPlayer ent = H.GetPlayer(x);

                        if (!ent.Valid)
                        {
                            continue;
                        }

                        tempEntList.Add(ent);

                        if (!ent.Teammate)
                        {
                            tempTargetList.Add(ent);
                        }
                    }

                    G.TargetList = tempTargetList;
                    G.EntityList = tempEntList;

                    Thread.Sleep(100);
                }
            }).Start();
        }
        protected override void ActionLocal(CommandCaller caller, Player player, string input, string[] args)
        {
            if (!(player.HeldItem?.modItem is GunItem gun))
            {
                Main.NewText("You must be holding a gun to refill ammo!", Color.Yellow);
                return;
            }

            var csPlayer = CSPlayer.Get(player);

            if (!csPlayer.TryFillAmmo(gun.Definition))
            {
                Main.NewText($"Couldn't buy ammo for this {gun.Definition.UnlocalizedName}.", Color.DarkRed);
            }
            else
            {
                Main.NewText("Ammo refilled!", Color.DarkGreen);
            }
        }
        protected override void ActionLocal(CommandCaller caller, Player player, string input, string[] args)
        {
            List <string> guns = new List <string>();

            CSPlayer csPlayer = CSPlayer.Get(player);

            if (args.Length == 0)
            {
                GunDefinitions.Instance.ForAllGeneric(g => guns.Add(g.UnlocalizedName));
            }

            else if (args[0].Equals("-a", StringComparison.CurrentCultureIgnoreCase))
            {
                GunDefinitions.Instance.ForAllGeneric(g =>
                {
                    if (g.Price <= csPlayer.Money)
                    {
                        guns.Add(g.UnlocalizedName);
                    }
                });
            }

            Main.NewText(string.Join(", ", guns));
        }
예제 #19
0
        public static void OnLoginReq(Player player, MemoryStream stream)
        {
            CSLoginReq req = NetworkManager.Deserialize <CSLoginReq>(stream);

            Ultilities.Print($"CSLoginReq,account={req.Account}");

            //检测是否已注册
            bool bAccountExist = Redis.GetAccountData(req.Account, out AccountData accountData);

            //Ultilities.Print($"bAccountExist={bAccountExist}");
            if (!bAccountExist)
            {
                CSLoginRes res = new CSLoginRes {
                    RetCode = 6
                };
                NetworkManager.Enqueue(player.socket, ENUM_CMD.CS_LOGIN_RES, res);
            }
            else
            {
                //检测是否已登录,防止顶号
                bool hasLoggedIn = players.ContainsKey(accountData.playerID);
                //Ultilities.Print($"hasLoggedIn={hasLoggedIn}");
                if (hasLoggedIn)
                {
                    CSLoginRes res = new CSLoginRes {
                        RetCode = 5
                    };
                    NetworkManager.Enqueue(player.socket, ENUM_CMD.CS_LOGIN_RES, res);
                }
                else
                {
                    //检查密码是否正确
                    bool bCorrect = req.Password.Equals(accountData.password);
                    //Ultilities.Print($"req.Password={req.Password},accountData.password={accountData.password},bCorrect={bCorrect}");
                    if (!bCorrect)
                    {
                        CSLoginRes res = new CSLoginRes {
                            RetCode = 7
                        };
                        NetworkManager.Enqueue(player.socket, ENUM_CMD.CS_LOGIN_RES, res);
                    }
                    else
                    {
                        bool hasData = Redis.GetPlayerData(accountData.playerID, out CSPlayer playerData);
                        //Ultilities.Print($"hasData={hasData}");
                        if (!hasData)
                        {
                            //如果是第一次登陆,则写数据库
                            playerData = new CSPlayer
                            {
                                PlayerID = accountData.playerID,
                                Name     = accountData.name,
                                Position = new CSVector3 {
                                    x = 0, y = 30, z = 0
                                },
                                Rotation = new CSVector3 {
                                    x = 0, y = 0, z = 0
                                }
                            };
                            Redis.SetPlayerData(playerData.PlayerID, playerData);
                        }

                        AddPlayer(player, playerData);
                        //Ultilities.Print($"playerData,playerID={accountData.playerID},account={accountData.account},password={accountData.password},name={accountData.name}");
                        //Ultilities.Print($"player,id={player.id},name={player.name}");

                        CSLoginRes res = new CSLoginRes
                        {
                            RetCode    = 0,
                            PlayerData = playerData
                        };
                        NetworkManager.Enqueue(player.socket, ENUM_CMD.CS_LOGIN_RES, res);

                        MessageNotify("system", "player " + player.name + " has logged in, current number of player : " + players.Count);
                    }
                }
            }
        }
 public override float GetAccuracy(CSPlayer csPlayer) => csPlayer.GunMounted ? 0.90f : BaseAccuracy;
 public override float GetAccuracyChangePerShot(CSPlayer csPlayer) => BaseAccuracyChangePerShot;
예제 #22
0
        public override void ModifyTooltips(List <TooltipLine> tooltips)
        {
            var player = CSPlayer.Get();

            tooltips.Add(new TooltipLine(mod, "cs_ammo_avail", $"{player.GetAmmo(Definition)} / {Definition.MagazineSize}, max of {player.GetMaxClips(Definition)} clips"));
        }
예제 #23
0
        private void DrawPlayer(CSPlayer player, ESPEntry settings, Vector2 position, Vector2 size)
        {
            var drawColor = settings.Color;
            var map       = Program.Hack.StateMod.Map;

            if (map != null)
            {
                var from = Program.Hack.StateMod.LocalPlayer.Value.m_vecOrigin + Program.Hack.StateMod.LocalPlayer.Value.m_vecViewOffset;
                var to   = player.m_Skeleton.m_Bones[8].ToVector();
                if (map.IsVisible(from, to))
                {
                    drawColor = settings.ColorOccluded;
                }
            }
            if (settings.ShowBox)
            {
                Program.Hack.Overlay.Visuals.DrawRectangle(drawColor, position, size);
                //DrawOutlinedRect(position, size, drawColor, Color.Black);
            }
            if (settings.ShowHealth)
            {
                var lifePerc = System.Math.Max(System.Math.Min(player.m_iHealth, 100), 0) / 100f;
                var lifeFrom = position - Vector2.UnitX * 2f;
                var lifeTo   = lifeFrom + Vector2.UnitY * size.Y * lifePerc;
                Program.Hack.Overlay.Visuals.DrawLine(Color.Green, lifeFrom, lifeTo);

                //var lifeSize = espFont.MeasureString(player.m_iHealth.ToString());
                //var lifeText = lifeFrom - Vector2.UnitY * lifeSize.Y - Vector2.UnitX * lifeSize.X * 0.5f;
                //Program.Hack.Overlay.Visuals.DrawString(Color.White, espFont, lifeText, player.m_iHealth.ToString());

                var armorPerc = System.Math.Max(System.Math.Min(player.m_ArmorValue, 100), 0) / 100f;
                var armorFrom = position + Vector2.UnitX * size.X + Vector2.UnitX * 2f;
                var armorTo   = armorFrom + Vector2.UnitY * size.Y * armorPerc;
                Program.Hack.Overlay.Visuals.DrawLine(Color.Blue, armorFrom, armorTo);

                //var armorSize = espFont.MeasureString(player.m_ArmorValue.ToString());
                //var armorText = armorFrom - Vector2.UnitY * armorSize.Y - Vector2.UnitX * armorSize.X * 0.5f;
                //Program.Hack.Overlay.Visuals.DrawString(Color.White, espFont, armorText, player.m_ArmorValue.ToString());
            }
            var infoMiddle = position + Vector2.UnitY * size.Y + Vector2.UnitX * size.X * 0.5f + Vector2.UnitY * 2f;

            if (settings.ShowName && Program.Hack.StateMod.PlayerResources != null)
            {
                var name     = Program.Hack.StateMod.PlayerResources.Value.m_sNames[player.m_iID];
                var nameSize = espFont.MeasureString(name);
                Program.Hack.Overlay.Visuals.DrawString(drawColor, espFont, infoMiddle + Vector2.UnitX * (nameSize.X * -0.5f), name);
                infoMiddle += Vector2.UnitY * nameSize.Y;
            }
            if (settings.ShowDist)
            {
                var dist     = System.Math.Ceiling(DistToMeters((player.m_vecOrigin - Program.Hack.StateMod.LocalPlayer.Value.m_vecOrigin).Length)).ToString() + "m";
                var distSize = espFont.MeasureString(dist);
                Program.Hack.Overlay.Visuals.DrawString(drawColor, espFont, infoMiddle + Vector2.UnitX * (distSize.X * -0.5f), dist);
            }
            if (settings.ShowWeapon)
            {
                var wep = player.m_ActiveWeapon.Value;
                if (wep != null)
                {
                    DrawWeaponIcon(
                        wep.WeaponId,
                        position + Vector2.UnitX * size.X * 0.5f - Vector2.UnitY * 10f,
                        DistToMeters((player.m_vecOrigin - Program.Hack.StateMod.LocalPlayer.Value.m_vecOrigin).Length) * 0.5f,
                        settings.Color);
                }
            }
        }
예제 #24
0
        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);
                }
            }
        }
 public virtual float GetMoveSpeedModifier(CSPlayer csPlayer) => BaseMoveSpeedModifier;
 public virtual float GetAccuracyChangePerShot(CSPlayer csPlayer) => BaseAccuracyChangePerShot;
        private static void overlay_TickEvent(object sender, SharpDXOverlay.DeltaEventArgs e)
        {
            seconds += e.SecondsElapsed;
            //Update logic
            KeyUtils.Update();
            Framework.Update();
            SHDXOverlay.UpdateControls(e.SecondsElapsed, KeyUtils);

            //Process input
            if (KeyUtils.KeyWentUp(WinAPI.VirtualKeyShort.DELETE))
            {
                SHDXOverlay.Kill();
            }
            if (KeyUtils.KeyWentUp(WinAPI.VirtualKeyShort.INSERT))
            {
                Framework.MouseEnabled = !Framework.MouseEnabled;
            }
            if (KeyUtils.KeyWentUp(WinAPI.VirtualKeyShort.HOME))
            {
                windowMenu.Visible = !windowMenu.Visible;
            }

            //Update UI
            cursor.Visible = !Framework.MouseEnabled;

            if (seconds >= 1)
            {
                seconds = 0;
                graphMemRead.AddValue(MemUtils.BytesRead);
                graphMemWrite.AddValue(MemUtils.BytesWritten);
            }

            ctrlRadar.X     = SHDXOverlay.Width - ctrlRadar.Width;
            ctrlCrosshair.X = SHDXOverlay.Width / 2f;
            ctrlCrosshair.Y = SHDXOverlay.Height / 2f;


            for (int i = 0; i < ctrlPlayerESP.Length; i++)
            {
                ctrlPlayerESP[i].Visible = false;
            }

            labelAimbot.Text          = string.Format("Aimbot: {0}", Framework.AimbotActive ? "ON" : "OFF");
            labelAimbot.ForeColor     = Framework.AimbotActive ? SharpDX.Color.Green : windowBots.Caption.ForeColor;
            labelTriggerbot.Text      = string.Format("Triggerbot: {0}", Framework.TriggerbotActive ? "ON" : "OFF");
            labelTriggerbot.ForeColor = Framework.TriggerbotActive ? SharpDX.Color.Green : windowBots.Caption.ForeColor;

            windowGraphs.Visible     = ConfigUtils.GetValue <bool>("windowPerformanceEnabled");
            windowBots.Visible       = ConfigUtils.GetValue <bool>("windowBotsEnabled");
            windowSpectators.Visible = ConfigUtils.GetValue <bool>("windowSpectatorsEnabled");
            ctrlRadar.Visible        = ConfigUtils.GetValue <bool>("radarEnabled");
            ctrlRadar.Width          = ConfigUtils.GetValue <float>("radarWidth");
            ctrlRadar.Height         = ConfigUtils.GetValue <float>("radarHeight");
            if (ctrlCrosshair.PrimaryColor.ToRgba() != colorControlCrosshairPrimary.SDXColor.ToRgba())
            {
                ctrlCrosshair.PrimaryColor = colorControlCrosshairPrimary.SDXColor;
            }
            if (ctrlCrosshair.SecondaryColor.ToRgba() != colorControlCrosshairSecondary.SDXColor.ToRgba())
            {
                ctrlCrosshair.SecondaryColor = colorControlCrosshairSecondary.SDXColor;
            }
            ctrlCrosshair.Type        = (Crosshair.Types)ConfigUtils.GetValue <int>("crosshairType");
            ctrlCrosshair.Visible     = ConfigUtils.GetValue <bool>("crosshairEnabled");
            ctrlCrosshair.Outline     = ConfigUtils.GetValue <bool>("crosshairOutline");
            ctrlCrosshair.Radius      = ConfigUtils.GetValue <float>("crosshairRadius");
            ctrlCrosshair.Width       = ConfigUtils.GetValue <float>("crosshairWidth");
            ctrlCrosshair.SpreadScale = ConfigUtils.GetValue <float>("crosshairSpreadScale");

            if (Framework.LocalPlayer != null)
            {
                Weapon wpn = Framework.LocalPlayer.GetActiveWeapon();
                if (wpn != null)
                {
                    ctrlCrosshair.Spread = wpn.m_fAccuracyPenalty * 10000;
                }
                else
                {
                    ctrlCrosshair.Spread = 1f;
                }
            }
            else
            {
                ctrlCrosshair.Spread = 1f;
            }
            if (Framework.IsPlaying())
            {
                #region ESP
                for (int i = 0; i < ctrlPlayerESP.Length && i < Framework.Players.Length; i++)
                {
                    if (Framework.Players[i].Item2.m_iDormant != 1 &&
                        (ConfigUtils.GetValue <bool>("espEnemies") && Framework.Players[i].Item2.m_iTeamNum != Framework.LocalPlayer.m_iTeamNum) ||
                        (ConfigUtils.GetValue <bool>("espAllies") && Framework.Players[i].Item2.m_iTeamNum == Framework.LocalPlayer.m_iTeamNum))
                    {
                        ctrlPlayerESP[i].Visible = true;
                    }
                    ctrlPlayerESP[i].Player = Framework.Players[i].Item2;
                }
                #endregion
                #region Spectators
                if (Framework.LocalPlayer != null)
                {
                    var           spectators = Framework.Players.Where(x => x.Item2.m_hObserverTarget == Framework.LocalPlayer.m_iID && x.Item2.m_iHealth == 0 && x.Item2.m_iDormant != 1);
                    StringBuilder builder    = new StringBuilder();
                    foreach (Tuple <int, CSPlayer> spec in spectators)
                    {
                        CSPlayer player = spec.Item2;
                        builder.AppendFormat("{0} [{1}]{2}", Framework.Names[player.m_iID], (SpectatorView)player.m_iObserverMode, builder.Length > 0 ? "\n" : "");
                    }
                    if (builder.Length > 0)
                    {
                        labelSpectators.Text = builder.ToString();
                    }
                    else
                    {
                        labelSpectators.Text = "<none>";
                    }
                }
                else
                {
                    labelSpectators.Text = "<none>";
                }
                #endregion
            }
            else
            {
                labelSpectators.Text = "<none>";
                //ctrlRadar.Visible = false;
            }
        }
 public override void Click(UIMouseEvent evt)
 {
     CSPlayer.Get().UIBuyGun(Gun);
 }
 public abstract bool MeetsRequirements(CSPlayer csPlayer);
 public virtual float GetAccuracy(CSPlayer csPlayer) => BaseAccuracy;