Beispiel #1
0
        private void RemovePlayerRadioChannel(int netId, string radioChannelName)
        {
            Player player = this.Players[netId];

            if (!VoiceManager._voiceClients.TryGetValue(player, out VoiceClient voiceClient))
            {
                return;
            }

            VoiceManager.LeaveRadioChannel(voiceClient, radioChannelName);
        }
        private void OnLeaveRadioChannel(Player player, string[] args)
        {
            if (args.Length < 1)
            {
                player.SendChatMessage("Usage", "/leaveradio {radioChannelName}");
                return;
            }

            VoiceManager.LeaveRadioChannel(player, args[0]);

            player.SendChatMessage("Radio", $"You left channel \"{args[0]}\".");
        }
        public static void LeaveRadioChannel(GTANetworkAPI.Client player)
        {
            if (!VoiceManager.TryGetVoiceClient(player, out VoiceClient voiceClient))
            {
                return;
            }

            foreach (RadioChannel radioChannel in VoiceManager.RadioChannels.Where(r => r.IsMember(voiceClient)))
            {
                VoiceManager.LeaveRadioChannel(player, radioChannel.Name);
            }
        }
Beispiel #4
0
        private void OnJoinRadioChannel([FromSource] Player player, string radioChannelName, bool isPrimary)
        {
            if (!VoiceManager._voiceClients.TryGetValue(player, out VoiceClient voiceClient))
            {
                return;
            }

            VoiceManager.LeaveRadioChannel(voiceClient, isPrimary);

            if (!String.IsNullOrEmpty(radioChannelName))
            {
                VoiceManager.JoinRadioChannel(voiceClient, radioChannelName, isPrimary);
            }
        }
Beispiel #5
0
        private void OnLeaveRadioChannel(Player player, string[] args)
        {
            if (args.Length < 1)
            {
                player.SendChatMessage("Usage", "/leaveradio {radioChannelName}");
                return;
            }

            if (!VoiceManager._voiceClients.TryGetValue(player, out VoiceClient voiceClient))
            {
                return;
            }

            VoiceManager.LeaveRadioChannel(voiceClient, args[0]);

            player.SendChatMessage("Radio", $"You left channel \"{args[0]}\".");
        }
        private void RemovePlayerRadioChannel(int netId, string radioChannelName)
        {
            Player player = this.Players[netId];

            VoiceManager.LeaveRadioChannel(player, radioChannelName);
        }
        public void OnLeaveRadioChannel(GTANetworkAPI.Client player, string channelName)
        {
            VoiceManager.LeaveRadioChannel(player, channelName);

            player.SendChatMessage("Radio", $"You left channel \"{channelName}\".");
        }