setPlayerVoiceIgnoreFrom | Multi Theft Auto: Wiki Skip to content

setPlayerVoiceIgnoreFrom

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function allows you to mute voices for a player.

Important

This function should only be used as a low-level function for advanced users. For typical Voice scripting, please see the Voice Resource

Syntax

setPlayerVoiceIgnoreFrom ( )

Code Examples

server
function voiceMuteFunction( Muter , cmd , MutedName , mutual)
if not MutedName then
return outputChatBox("Syntax: /".. cmd .." <player name> <mutual>", Muter)
end
local Muted = getPlayerFromName(MutedName)
if not Muted then
return outputChatBox('enter the correct player name' , Muter)
end
if Muted == Muter then
return outputChatBox("You cannot mute yourself!", Muter)
end
if mutual then --enter any string as the second arg for making this mute mutual or enter nothing to make it one-way
setPlayerVoiceIgnoreFrom(Muter,Muted)
setPlayerVoiceIgnoreFrom(Muted,Muter)
else
setPlayerVoiceIgnoreFrom(Muter,Muted)
end
end
addCommandHandler('voiceMute' ,voiceMuteFunction )
-- e.g. /voiceMute jacky y (mutual)
-- e.g. /voiceMute jacky (one-way)

See Also