Exemplo n.º 1
0
        private void OnPlayerConnect(ServerPlayer player, string reason)
        {
            MainNormalVoiceChannel.AddPlayer(player);

            MainWhisperVoiceChannel.AddPlayer(player);
            MainWhisperVoiceChannel.MutePlayer(player);

            MainShoutVoiceChannel.AddPlayer(player);
            MainShoutVoiceChannel.MutePlayer(player);

            PoliceMegaphoneVoiceChannel.AddPlayer(player);
            PoliceMegaphoneVoiceChannel.MutePlayer(player);

            player.VoiceLevel = PlayerVoiceLevel.Normal;
        }
Exemplo n.º 2
0
        public void ChangeVoiceLevel(ServerPlayer player, PlayerVoiceLevel newLevel)
        {
            switch (newLevel)
            {
            case PlayerVoiceLevel.Mute:
                MainWhisperVoiceChannel.MutePlayer(player);
                MainNormalVoiceChannel.MutePlayer(player);
                MainShoutVoiceChannel.MutePlayer(player);
                PoliceMegaphoneVoiceChannel.MutePlayer(player);
                break;

            case PlayerVoiceLevel.Whisper:
                MainWhisperVoiceChannel.UnmutePlayer(player);
                MainNormalVoiceChannel.MutePlayer(player);
                MainShoutVoiceChannel.MutePlayer(player);
                PoliceMegaphoneVoiceChannel.MutePlayer(player);
                break;

            case PlayerVoiceLevel.Normal:
                MainWhisperVoiceChannel.MutePlayer(player);
                MainNormalVoiceChannel.UnmutePlayer(player);
                MainShoutVoiceChannel.MutePlayer(player);
                PoliceMegaphoneVoiceChannel.MutePlayer(player);
                break;

            case PlayerVoiceLevel.Shout:
                MainWhisperVoiceChannel.MutePlayer(player);
                MainNormalVoiceChannel.MutePlayer(player);
                MainShoutVoiceChannel.UnmutePlayer(player);
                PoliceMegaphoneVoiceChannel.MutePlayer(player);
                break;

            case PlayerVoiceLevel.PoliceMegaphone:
                MainWhisperVoiceChannel.MutePlayer(player);
                MainNormalVoiceChannel.MutePlayer(player);
                MainShoutVoiceChannel.MutePlayer(player);
                PoliceMegaphoneVoiceChannel.UnmutePlayer(player);
                break;
            }

            player.VoiceLevel = newLevel;
        }