public static void Run(SvPlayer player, string message) { if (!LatestVotePeople.Any()) { player.SendChatMessage($"<color={infoColor}>The list seems empty.</color>"); return; } string content = string.Join("\r\n", LatestVotePeople); player.Send(SvSendType.Self, Channel.Unsequenced, ClPacket.ServerInfo, "\r\nPlayers that voted 'yes' on the latest votekick: \r\n\r\n" + content); }
public static bool SvStartVote(SvPlayer player, ref byte voteIndex, ref int ID) { switch (voteIndex) { case VoteIndex.Mission: if (!BlockMissions) { return(false); } player.SendChatMessage($"<color={errorColor}>All missions have been disabled on this server.</color>"); return(true); case VoteIndex.Kick: if (VoteKickDisabled) { player.SendChatMessage($"<color={errorColor}>Vote kicking has been disabled on this server.</color>"); return(true); } if (!PlayerList.TryGetValue(ID, out var shPlayer)) { return(true); } if (player.svManager.vote != null || voteIndex >= player.player.manager.votes.Length || player.svManager.startedVote.OverLimit(player.player)) { return(true); } player.svManager.startedVote.Add(player.player); player.svManager.vote = player.player.manager.votes[voteIndex]; if (!player.svManager.vote.CheckVote(ID)) { player.svManager.vote = null; } player.Send(SvSendType.All, Channel.Reliable, 60, voteIndex, ID); player.svManager.StartCoroutine(player.svManager.StartVote()); Debug.Log($"{PlaceholderParser.ParseTimeStamp()} [INFO] {player.playerData.username} Has issued a votekick against {player.player.username}"); player.Send(SvSendType.All, Channel.Unsequenced, ClPacket.GameMessage, $"<color={argColor}>{player.playerData.username} </color><color={warningColor}>Has issued a vote kick against</color><color={argColor}> {shPlayer.ShPlayer.username}</color>"); LatestVotePeople.Clear(); return(true); default: return(false); } }
public static void SvVoteYes(SvPlayer player) { LatestVotePeople.Add(player.playerData.username); }