Exemplo 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
                    }
                }
            }
        }
Exemplo n.º 2
0
 public void RemovePlayerToPermaKill(Player player)
 {
     PermaKillPlayers.Remove(player.SteamId);
 }
Exemplo n.º 3
0
 public void AddPlayerToPermaKill(Player player)
 {
     PermaKillPlayers.Add(player.SteamId);
 }