Player::enableVoiceTo

From RAGE Multiplayer Wiki
Jump to navigation Jump to search

This function is used to enable voice listening to a certain player.

Server-Side
Function

C.png C# Js.png JavaScript




C# Syntax
C.png

player.EnableVoiceTo(Client target);

Parameters

  • target: The Player you want to listen to.

Example

[Command("listento")]
public void ListenToTarget(Client player, Client target)
{
    player.EnableVoiceTo(target);

    //If you want it to be bidirectional
    target.EnableVoiceTo(player);
}


JavaScript Syntax
Jslogo.png

player.enableVoiceTo(Player player)

Parameters

  • player: The Player you want to listen to.

Example

This example below shows how all players can hear the player with ID "0".

let player = mp.players.at(0);

mp.players.forEach((_player) => {
        if(player == _player) return false;
        
        player.enableVoiceTo(_player);
});


See Also