Esempio n. 1
0
        private void OnTick(object sender, EventArgs args)
        {
            // Only in Multiplayer
            if (!BoltNetwork.isRunning)
            {
                return;
            }

            // Remove missing players to kill
            foreach (ulong steamId in PermaKillPlayers.ToArray().Where(steamId => GriefClientPro.PlayerManager.GetPlayerBySteamId(steamId) == null))
            {
                PermaKillPlayers.Remove(steamId);
            }

            // Execute PermaKill
            if (PermaKillPlayers.Count > 0)
            {
                foreach (ulong steamId in PermaKillPlayers)
                {
                    try
                    {
                        Player player = GriefClientPro.PlayerManager.GetPlayerBySteamId(steamId);
                        if (player != null)
                        {
                            // Kill the player
                            KillSinglePlayer(player.CoopPlayer);
                        }
                    }
                    catch (Exception)
                    {
                        // ignored
                    }
                }
            }
        }
Esempio n. 2
0
 public void RemovePlayerToPermaKill(Player player)
 {
     PermaKillPlayers.Remove(player.SteamId);
 }