Player::disableVoiceTo

From RAGE Multiplayer Wiki
Jump to navigation Jump to search

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

Server-Side
Function

C.png C# Js.png JavaScript



C# Syntax
C.png

player.DisableVoiceTo(Client target);

Parameters

  • target: The Player you want to stop listen to.

Example

[Command("stoplistento")]
public void StopListenToTarget(Client player, Client target)
{
    player.DisableVoiceTo(target);

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


JavaScript Syntax
Jslogo.png

player.disableVoiceTo(Player target)

Parameters

  • target: The Player you want to stop listen to.

Example

This example below disables all players from hearing the player with ID '0'.

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

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


See Also