If this is not solved yet, try this: 
addCommandHandler("mute",function(player,command, target) 
    if not(target)then outputChatBox("SYNTAX: /"..command.." [PlayerName]", player) end 
    local target = string(target) 
    local playerName = getPlayerFromNamePart(target) 
    if(playerName)then 
        local targetAcc = getAccountName(getPlayerAccount(playerName)) 
        if(hasObjectPermissionTo(player,"command.aexec",false))then 
            if(targetAcc)then 
                local mute = setPlayerMuted(target,true) 
                if ( mute ) then 
                    setAccountData(targetAcc, "muted", mute) 
                    outputChatBox(""..targetAcc.." has been muted!", player) 
                end 
            end 
        else 
            outputChatBox("Sorry, you don't have permission to mute a player.",player) 
        end 
    else 
        outputChatBox("Sorry, that player name doesn't exist.",player) 
    end 
end)