function mutePlayer(player,command,victimName)
if victimName then
local victim = getPlayerFromName(victimName)
if victim then
if ( not isPlayerMuted(victim) ) then
setPlayerMuted(victim, true)
outputChatBox("You have been muted.",victim)
setElementData(victim, "muted", true)
end
else
outputChatBox("Could not find player with name: "..tostring(victimName),player)
end
else
outputChatBox("Usage: /mute ",player)
end
end
addCommandHandler("mute",mutePlayer)
Client
function DXtext ()
local muted = getElementData(localPlayer, "muted") or false
local value
if (muted) then
value = "Yes"
else
value = "No"
end
local sWidth,sHeight = guiGetScreenSize()
dxDrawText("Mute: "..value,sWidth*0.900, sHeight*0.452, sWidth*0.715, sHeight*0.997,tocolor(255,255,255,175),0.8,"bankgothic","left","top",false,false,false)
end
addEventHandler ( "onClientRender", getRootElement(), DXtext )