Player::disableVoiceTo
This function is used to disable voice listening to a certain player.
Server-Side Function
C# | JavaScript |
---|
C# Syntax
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
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);
});