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 } } } }
public void RemovePlayerToPermaKill(Player player) { PermaKillPlayers.Remove(player.SteamId); }