VoiceChannel
@vimp-mp/types 2.0.1Server-owned voice channel and its per-player routing permissions.
ts
interface VoiceChannelMembers
id
ts
readonly id: numberServer-assigned channel identifier.
maxDistance
ts
readonly maxDistance: number | nullMaximum audible distance, or null for a non-spatial channel.
name
ts
readonly name: stringApplication-defined channel name.
players
ts
readonly players: Array<Player>Players currently routed through this channel.
spatial
ts
readonly spatial: booleanWhether the channel uses distance-based attenuation.
addPlayer
ts
addPlayer(player: number | Player, permissions?: VoicePermissions): booleanAdds a connected player; omitted permissions allow speaking and listening.
destroy
ts
destroy(): booleanDestroys this voice channel instance.
getPlayerPermissions
ts
getPlayerPermissions(player: number | Player): VoicePermissions | nullReturns the member's routing permissions, or null if they are not a member.
hasPlayer
ts
hasPlayer(player: number | Player): booleanReports whether the player is a member of this channel.
removePlayer
ts
removePlayer(player: number | Player): booleanRemoves a player from this channel. Returns false if no membership existed.
setPlayerPermissions
ts
setPlayerPermissions(player: number | Player, permissions: VoicePermissions): booleanReplaces a member's speaking and listening permissions.